/* 
 * Gallery Page Layout System for iPortfolio Theme
 * Comprehensive slideshow, title, caption, and description styling
 */

/* =================
   GALLERY OVERALL LAYOUTS
   ================= */
.gallery-layout-default .gallery-project {
    display: block;
}

.gallery-layout-full-width .gallery-project {
    width: 100%;
    max-width: none;
}

.gallery-layout-full-width .project-slideshow {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    max-width: none;
}

.gallery-layout-centered .gallery-project {
    max-width: 900px;
    margin: 0 auto;
}

.gallery-layout-masonry .gallery-section {
    column-count: 1;
    column-gap: 2rem;
}

.gallery-layout-masonry .gallery-project {
    break-inside: avoid;
    margin-bottom: 2rem;
    display: inline-block;
    width: 100%;
}

/* =================
   SLIDESHOW STYLES
   ================= */
.slideshow-style-default .project-slideshow {
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.slideshow-style-modern .project-slideshow {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
}

.slideshow-style-minimal .project-slideshow {
    box-shadow: none;
    border: none;
}

.slideshow-style-minimal .carousel-control-prev,
.slideshow-style-minimal .carousel-control-next,
.slideshow-style-minimal .carousel-indicators {
    display: none;
}

.slideshow-style-fullscreen .project-slideshow {
    position: relative;
    width: 100%;
    height: 60vh;
}

.slideshow-style-fullscreen .project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Enhanced carousel controls */
.slideshow-style-modern .carousel-control-prev,
.slideshow-style-modern .carousel-control-next {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

.slideshow-style-modern .project-slideshow:hover .carousel-control-prev,
.slideshow-style-modern .project-slideshow:hover .carousel-control-next {
    opacity: 1;
}

.slideshow-style-modern .carousel-control-prev {
    left: 15px;
}

.slideshow-style-modern .carousel-control-next {
    right: 15px;
}

.slideshow-style-modern .carousel-control-prev-icon,
.slideshow-style-modern .carousel-control-next-icon {
    background-color: #149ddd;
    border-radius: 50%;
    padding: 8px;
}

.slideshow-style-modern .carousel-indicators {
    bottom: -30px;
}

.slideshow-style-modern .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #149ddd;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.slideshow-style-modern .carousel-indicators .active {
    opacity: 1;
    transform: scale(1.2);
}

/* =================
   PROJECT TITLE ALIGNMENT
   ================= */
.title-alignment-left .project-header {
    text-align: left;
}

.title-alignment-center .project-header {
    text-align: center;
}

.title-alignment-right .project-header {
    text-align: right;
}

/* =================
   PROJECT TITLE STYLES
   ================= */
.title-style-default .project-title {
    font-size: 2rem;
    font-weight: 600;
    color: #040b14;
    margin-bottom: 0.5rem;
}

.title-style-large .project-title {
    font-size: 3rem;
    font-weight: 800;
    color: #040b14;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.title-style-elegant .project-title {
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: #149ddd;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.title-style-minimal .project-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* =================
   CAPTION POSITIONS
   ================= */
.caption-position-bottom .carousel-caption {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.caption-position-top .carousel-caption {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(rgba(0,0,0,0.8), transparent);
}

.caption-position-center .carousel-caption {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    border-radius: 8px;
    padding: 1rem 2rem;
}

.caption-position-below .carousel-caption {
    position: static;
    background: none;
    color: #333;
    padding: 1rem 0;
    text-align: center;
}

.caption-position-hidden .carousel-caption {
    display: none !important;
}

/* =================
   CAPTION STYLES
   ================= */
.caption-style-default .carousel-caption {
    background: rgba(0,0,0,0.8);
    color: white;
    border-radius: 0;
}

.caption-style-light .carousel-caption {
    background: rgba(255,255,255,0.95);
    color: #333;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.caption-style-gradient .carousel-caption {
    background: linear-gradient(135deg, #149ddd, #0d8abc);
    color: white;
    border-radius: 8px;
}

.caption-style-minimal .carousel-caption {
    background: none;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    border-radius: 0;
}

/* =================
   DESCRIPTION LAYOUTS
   ================= */
.description-layout-default .row {
    display: flex;
    align-items: stretch;
}

.description-layout-left .row {
    flex-direction: row-reverse;
}

.description-layout-bottom .gallery-project {
    display: flex;
    flex-direction: column;
}

.description-layout-bottom .project-slideshow {
    order: 1;
}

.description-layout-bottom .project-description {
    order: 2;
    margin-top: 2rem;
}

.description-layout-top .gallery-project {
    display: flex;
    flex-direction: column;
}

.description-layout-top .project-slideshow {
    order: 2;
}

.description-layout-top .project-description {
    order: 1;
    margin-bottom: 2rem;
}

.description-layout-overlay .project-description {
    position: absolute;
    top: 0;
    right: 0;
    width: 35%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    padding: 2rem;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.description-layout-overlay .project-slideshow {
    position: relative;
}

/* =================
   DESCRIPTION STYLES
   ================= */
.description-style-default .project-description {
    padding: 1rem;
    background: transparent;
}

.description-style-card .project-description {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 2rem;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.description-style-card .project-description:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.description-style-bordered .project-description {
    border: 2px solid #149ddd;
    border-radius: 8px;
    padding: 2rem;
    background: #f8f9fa;
}

.description-style-minimal .project-description {
    padding: 1rem 0;
    background: none;
    border: none;
}

/* =================
   GALLERY ITEM SPACING
   ================= */
.gallery-spacing-compact .gallery-project {
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.gallery-spacing-compact .project-separator {
    margin: 1.5rem 0;
}

.gallery-spacing-normal .gallery-project {
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.gallery-spacing-normal .project-separator {
    margin: 3rem 0;
}

.gallery-spacing-spacious .gallery-project {
    margin-bottom: 6rem;
    padding: 3rem 0;
}

.gallery-spacing-spacious .project-separator {
    margin: 4rem 0;
}

/* =================
   ENHANCED INTERACTIONS
   ================= */
.project-slideshow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    height: 400px; /* Fixed container height */
}

.project-slideshow:hover {
    transform: translateY(-2px);
}

.carousel-item {
    transition: all 0.8s ease;
    height: 100%;
}

.project-image {
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Images resize to fill container, may crop to maintain aspect ratio */
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Additional carousel image targeting */
.carousel-item img,
.project-slideshow img,
.slideshow img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.project-slideshow:hover .project-image {
    transform: scale(1.02);
}

/* Technology tags enhanced */
.tech-tag {
    background: linear-gradient(135deg, #149ddd, #0d8abc);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0.2rem;
}

.tech-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 157, 221, 0.3);
}

/* Project links enhanced */
.project-links .btn {
    border-radius: 25px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin: 0.5rem 0.5rem 0.5rem 0;
}

.project-links .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* =================
   RESPONSIVE DESIGN
   ================= */
@media (max-width: 768px) {
    .gallery-layout-full-width .project-slideshow {
        width: 100%;
        margin-left: 0;
    }
    
    .gallery-layout-masonry .gallery-section {
        column-count: 1;
    }
    
    .description-layout-left .row,
    .description-layout-default .row {
        flex-direction: column;
    }
    
    .description-layout-overlay .project-description {
        position: static;
        width: 100%;
        background: white;
        margin-top: 1rem;
    }
    
    .title-style-large .project-title {
        font-size: 2rem;
    }
    
    .title-style-elegant .project-title {
        font-size: 1.8rem;
    }
    
    .slideshow-style-fullscreen .project-slideshow {
        height: 40vh;
    }
    
    .project-slideshow {
        height: 300px; /* Smaller fixed height on mobile */
    }
    
    .caption-position-center .carousel-caption {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .gallery-spacing-spacious .gallery-project,
    .gallery-spacing-normal .gallery-project {
        margin-bottom: 3rem;
        padding: 1.5rem 0;
    }
    
    .title-style-large .project-title,
    .title-style-elegant .project-title {
        font-size: 1.5rem;
    }
    
    .title-style-minimal .project-title {
        font-size: 1.2rem;
    }
    
    .slideshow-style-fullscreen .project-slideshow {
        height: 30vh;
    }
    
    .project-slideshow {
        height: 250px; /* Even smaller fixed height on small mobile */
    }
    
    .description-style-card .project-description {
        padding: 1.5rem;
    }
    
    .project-links .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* =================
   ANIMATION CLASSES
   ================= */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* =================
   ACCESSIBILITY ENHANCEMENTS
   ================= */
.project-slideshow:focus-within {
    outline: 3px solid #149ddd;
    outline-offset: 2px;
}

.carousel-control-prev:focus,
.carousel-control-next:focus {
    outline: 2px solid #149ddd;
    outline-offset: 2px;
}

.tech-tag:focus,
.project-links .btn:focus {
    outline: 2px solid #149ddd;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .caption-style-minimal .carousel-caption {
        background: rgba(0,0,0,0.9);
    }
    
    .tech-tag {
        border: 2px solid currentColor;
    }
    
    .description-style-card .project-description {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .project-slideshow,
    .project-image,
    .tech-tag,
    .project-links .btn {
        transition: none;
    }
    
    .fade-in,
    .slide-up,
    .scale-in {
        animation: none;
    }
}