/* Case Study Styles - Consistent with main profile */

.case-container {
    max-width: 740px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Case Header */
.case-header {
    margin-bottom: 40px;
    text-align: center;
}

.back-link {
    display: inline-block;
    font-size: 14px;
    color: #6D6D6D;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #111;
}

.case-title {
    font-size: 32px;
    font-weight: 400;
    color: #111;
    margin-bottom: 16px;
    line-height: 1.3;
}

.case-subtitle {
    font-size: 18px;
    color: #555;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto 24px;
}

.case-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #6D6D6D;
}

.meta-separator {
    color: #DDD;
}

/* Hero Image */
.case-hero {
    margin-bottom: 60px;
    border-radius: 12px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Case Content */
.case-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.case-section {
    margin-bottom: 48px;
}

.case-section h2 {
    font-size: 24px;
    font-weight: 400;
    color: #111;
    margin-bottom: 20px;
    line-height: 1.3;
}

.case-section h3 {
    font-size: 18px;
    font-weight: 500;
    color: #111;
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.case-section p {
    margin-bottom: 20px;
}

.case-section ul {
    margin-bottom: 20px;
    padding-left: 24px;
}

.case-section li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.case-section a {
    color: #111;
    text-decoration: none;
    position: relative;
}

.case-section a:hover {
    color: #111;
    text-decoration: underline;
}

.case-section a[target="_blank"]:after {
    content: "↗";
    font-size: 12px;
    margin-left: 2px;
    vertical-align: super;
    line-height: 1;
    text-decoration: none !important;
    display: inline-block;
}

/* Case Highlight Box */
.case-highlight {
    background: #F9F9F9;
    border: 1px solid #F0F0F0;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.case-highlight h3 {
    margin-top: 0;
}

/* Case Image */
.case-image {
    margin: 32px 0;
}

.case-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
}

.image-caption {
    font-size: 14px;
    color: #6D6D6D;
    text-align: center;
    margin-top: 12px;
    font-style: italic;
}

/* Video Preview */
.video-preview {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
}

.video-thumbnail {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.video-preview:hover .video-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.case-image .video-preview {
    display: block;
}

/* Case Metrics */
.case-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.case-metrics .metric {
    text-align: center;
    padding: 20px;
    background: #F2F2F2;
    border-radius: 8px;
}

.case-metrics .metric-value {
    font-size: 28px;
    font-weight: 400;
    color: #111;
    margin-bottom: 8px;
    display: block;
}

.case-metrics .metric-label {
    font-size: 14px;
    color: #6D6D6D;
}

/* Related Links */
.related-links {
    margin-top: 60px;
    padding-top: 40px;
    padding: 16px;
    border-top: 1px solid #F0F0F0;
}

@media (max-width: 730px) {
    .related-links {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.related-links h2 {
    font-size: 18px;
    font-weight: 400;
    color: #111;
    margin-bottom: 16px;
}

.related-links ul {
    list-style: none;
    padding: 0;
}

.related-links li {
    margin-bottom: 12px;
}

.related-links a {
    font-size: 15px;
    color: #111;
    text-decoration: none;
    position: relative;
}

.related-links a:hover {
    color: #111;
    text-decoration: underline;
}

.related-links a[target="_blank"]:after {
    content: "↗";
    font-size: 12px;
    margin-left: 2px;
    vertical-align: super;
    line-height: 1;
    text-decoration: none !important;
    display: inline-block;
}

/* Case Footer */
.case-footer {
    margin-top: 60px;
    margin-bottom: 180px;
    padding: 16px;
    padding-top: 40px;
    border-top: 1px solid #F0F0F0;
}

.case-navigation {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.nav-previous,
.nav-next {
    flex: 1;
    max-width: 45%;
}

.nav-previous {
    text-align: left;
}

.nav-next {
    text-align: left;
}

.nav-label {
    display: block;
    font-size: 13px;
    color: #6D6D6D;
    margin-bottom: 4px;
    font-weight: 400;
}

.nav-link {
    display: block;
    font-size: 15px;
    color: #111;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    position: relative;
}

.nav-link:hover {
    color: #111;
    text-decoration: underline;
}

@media (max-width: 730px) {
    .case-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .case-navigation {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .nav-previous,
    .nav-next {
        max-width: 100%;
    }
    
    .nav-label {
        font-size: 12px;
    }
    
    .nav-link {
        font-size: 14px;
    }
}

/* Floating Back Button */
.floating-back {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 24px;
    padding: 8px 16px 8px 12px;
    font-size: 14px;
    color: #6D6D6D;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.floating-back.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.floating-back:hover {
    color: #111;
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(200, 200, 200, 0.8);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateX(2px);
}

.floating-back::before {
    content: '←';
    font-size: 14px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.floating-back:hover::before {
    transform: translateX(-2px);
}

/* Mobile Responsive */
@media (max-width: 730px) {
    .case-container {
        padding: 24px 16px 60px;
    }
    
    .case-title {
        font-size: 24px;
    }
    
    .case-subtitle {
        font-size: 16px;
    }
    
    .case-meta {
        flex-wrap: wrap;
        font-size: 13px;
    }
    
    .case-content {
        font-size: 15px;
    }
    
    .case-section h2 {
        font-size: 20px;
    }
    
    .case-section h3 {
        font-size: 16px;
    }
    
    .case-highlight {
        padding: 20px;
    }
    
    .case-metrics {
        gap: 16px;
    }
    
    .floating-back {
        top: 16px;
        left: 16px;
        padding: 6px 12px 6px 10px;
        font-size: 13px;
        border-radius: 20px;
    }
    
    /* Mobile TOC - Exactly match profile design */
    .toc-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        min-width: auto;
        border-radius: 24px 24px 0 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.08);
        transform: translateY(calc(100% - 56px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .toc-container.expanded {
        transform: translateY(0);
    }
    
    .toc-header {
        padding: 16px 24px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        position: relative;
    }
    
    .toc-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
    
    .toc-title {
        font-size: 14px;
        font-weight: 600;
        color: #333;
    }
    
    .toc-toggle {
        display: none;
    }
    
    .toc-content {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        padding: 0;
    }
    
    .toc-container.expanded .toc-content {
        max-height: 60vh;
        overflow-y: auto;
        opacity: 1;
        padding: 8px 0 24px;
        -webkit-overflow-scrolling: touch;
    }
    
    .toc-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .toc-link {
        padding: 12px 24px;
        font-size: 14px;
        color: #555;
        text-decoration: none;
        display: block;
        transition: background-color 0.2s ease, color 0.2s ease;
    }
    
    .toc-link:hover {
        background: rgba(0, 0, 0, 0.03);
    }
    
    .toc-link.active {
        color: #1a1a1a;
        font-weight: 600;
        background: rgba(0, 0, 0, 0.05);
    }
    
    .toc-link.active::before {
        width: 3px;
        background: #1a1a1a;
    }
}

/* Desktop TOC - Override mobile styles */
@media (min-width: 731px) {
    .toc-container {
        position: fixed;
        top: 24px;
        right: 24px;
        bottom: auto;
        left: auto;
        width: auto;
        min-width: 200px;
        max-width: 280px;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(0, 0, 0, 0.04);
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
        transform: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .toc-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
        cursor: auto;
    }
    
    .toc-header::before {
        display: none;
    }
    
    .toc-title {
        font-size: 14px;
        font-weight: 500;
        color: #666;
    }
    
    .toc-toggle {
        display: flex !important;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        border-radius: 6px;
        color: #999;
        transition: all 0.2s ease;
        align-items: center;
        justify-content: center;
    }
    
    .toc-toggle:hover {
        background: rgba(0, 0, 0, 0.03);
        color: #666;
    }
    
    .toc-content {
        padding: 8px 0 16px;
        max-height: 400px;
        overflow-y: auto;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .toc-content.collapsed {
        max-height: 0;
        padding: 0;
        overflow: hidden;
    }
    
    .toc-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .toc-link {
        display: block;
        padding: 8px 20px;
        font-size: 13px;
        color: #888;
        text-decoration: none;
        transition: all 0.2s ease;
        position: relative;
        border-bottom: none;
    }
    
    .toc-link:hover {
        color: #555;
        background: rgba(0, 0, 0, 0.02);
    }
    
    .toc-link.active {
        color: #444;
        font-weight: 500;
        background: rgba(0, 0, 0, 0.03);
    }
    
    .toc-link.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 2px;
        background: #888;
        border-radius: 0 1px 1px 0;
    }
}