/* 
   Jagam Technologies - Case Studies Styles
   Upgraded Premium Media Showcase & Standardized Section Spacing
*/

/* Standardized Section Spacing Utility (Task 2) */
.section-spacing {
    padding-top: 42px;
    padding-bottom: 42px;
}

@media (max-width: 991.98px) {
    .section-spacing {
        padding-top: 35px;
        padding-bottom: 35px;
    }
}

@media (max-width: 575.98px) {
    .section-spacing {
        padding-top: 28px;
        padding-bottom: 28px;
    }
}

/* Case Study Cards */
.case-study-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 0;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.case-study-card:hover {
    border-color: var(--accent);
    box-shadow: var(--card-shadow);
}

.case-study-card:nth-child(even):hover {
    border-color: var(--primary);
    box-shadow: var(--card-shadow);
}

.case-study-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.case-study-category {
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.case-study-card:nth-child(even) .case-study-category {
    color: var(--primary);
}

/* Metrics panel on the right side */
.case-metrics-panel {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.case-metric-box {
    margin-bottom: 1.5rem;
}

.case-metric-box:last-child {
    margin-bottom: 0;
}

.case-metric-value {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.case-study-card:nth-child(even) .case-metric-value {
    color: var(--primary);
}

.case-metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Section columns for Challenge / Solution */
.case-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.case-section-title i {
    color: var(--accent);
}

.case-study-card:nth-child(even) .case-section-title i {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .case-study-card {
        padding: 2rem;
    }

    .case-metrics-panel {
        margin-top: 2rem;
    }
}

/* Our Strengths / Glass Cards */
.strength-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    font-size: 2.2rem;
    transition: .35s ease;
}

.innovation-icon {
    background: rgba(13, 110, 253, .12);
    color: #0d6efd;
}

.expertise-icon {
    background: rgba(255, 193, 7, .15);
    color: #ffc107;
}

.glass-card:hover .strength-icon {
    transform: scale(1.08);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 18px;
    line-height: 1.8;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.glass-card h3 {
    text-align: center;
    font-weight: 700;
}

.glass-card h5 {
    text-align: center;
    font-weight: 600;
}

.glass-card {
    height: 100%;
}

/* Statistics banner */
.case-stats-banner {
    margin-top: 2.5rem;
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
}

.case-stat {
    padding: 0.5rem 1rem;
}

.case-stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.case-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}


/* ==========================================
   TASK 1: UPGRADED MEDIA GALLERY SHOWCASE
   ========================================== */

.case-media-section {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

/* Container Styling: Clean, unified card with subtle border, soft drop shadow & rounded corners */
.case-media-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), var(--card-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.case-media-box:hover {
    border-color: var(--accent);
    box-shadow: 0 14px 36px rgba(246, 137, 32, 0.15), var(--card-shadow);
    transform: translateY(-3px);
}

.case-media-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.case-media-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(246, 137, 32, 0.12);
    border: 1px solid rgba(246, 137, 32, 0.3);
    color: var(--accent);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.case-media-header-text h3 {
    margin: 0 0 0.2rem 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
}

.case-media-header-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Media Viewers (Video & Image): Unified 16:9 Aspect Ratio Container */
.case-media-viewer {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    background: #090a0d;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video Element */
.case-media-viewer video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    display: block;
}

/* Image Element: Exact same height & border-radius as video container */
.case-media-viewer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    transition: opacity 0.3s ease;
}

/* Placeholder for empty state */
.case-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.case-media-placeholder i {
    font-size: 2rem;
    color: var(--accent);
}

.case-media-placeholder span {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Custom Semi-Transparent Play Button Overlay in center of video viewer */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.video-play-overlay i {
    margin-left: 4px; /* Optically center triangle */
}

.video-play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.12);
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(246, 137, 32, 0.5);
}

.video-play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Navigation Controls: Smaller, circular buttons with centered elegant counter */
.case-media-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.case-media-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.case-media-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(246, 137, 32, 0.35);
}

.case-media-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.case-media-counter {
    min-width: 80px;
    padding: 0.35rem 1rem;
    border-radius: 30px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Mookambika Blue Theme Overrides */
.mookambika-media-section .case-media-box:hover {
    border-color: #3b5cb8;
    box-shadow: 0 14px 36px rgba(59, 92, 184, 0.2);
}

.mookambika-media-section .case-media-icon {
    border-color: rgba(59, 92, 184, 0.35);
    background: rgba(59, 92, 184, 0.12);
    color: #3b5cb8;
}

.mookambika-media-section .case-media-header-text h3 {
    color: var(--text-white);
}

.mookambika-media-section .case-media-placeholder i {
    color: #3b5cb8;
}

.mookambika-media-section .case-media-btn:hover:not(:disabled) {
    background: #3b5cb8;
    border-color: #3b5cb8;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(59, 92, 184, 0.35);
}

.mookambika-media-section .video-play-overlay:hover {
    background: #3b5cb8;
    border-color: #3b5cb8;
    box-shadow: 0 10px 30px rgba(59, 92, 184, 0.5);
}

/* Light Mode Overrides */
html:not([data-theme="dark"]) .case-stats-banner {
    background: #f8f9fa;
}

html:not([data-theme="dark"]) .case-media-box {
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

html:not([data-theme="dark"]) .case-media-viewer {
    background: #0f1117;
}

html:not([data-theme="dark"]) .case-media-btn {
    background: #f8f9fa;
    color: var(--text-white);
}

html:not([data-theme="dark"]) .case-media-counter {
    background: #f8f9fa;
}

/* Responsive Scaling for Media & Sections */
@media (max-width: 991.98px) {
    .case-media-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .case-media-box {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .case-media-box {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .case-media-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .case-media-header-text h3 {
        font-size: 1.05rem;
    }

    .video-play-overlay {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }

    .case-media-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .case-media-counter {
        min-width: 70px;
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
}