/* =============================================
   TagTune Portfolio Case Study Styles
   Loaded only on tagtune.html
   ============================================= */

.portfolio-body {
    background-color: #ffffff;
    color: #2d3748;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    padding-bottom: 150px;
}

.portfolio-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-align: left;
    box-sizing: border-box;
}

.portfolio-container h1,
.portfolio-container h2,
.portfolio-container h3,
.portfolio-container h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #242582;
}

/* Accent colors */
.text-gradient {
    background: #242582;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Badge list */
.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.badge {
    background: rgba(246, 76, 114, 0.08);
    color: #f64c72;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(246, 76, 114, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.purple {
    background: rgba(162, 85, 255, 0.08);
    color: #8a3df5;
    border-color: rgba(162, 85, 255, 0.2);
}

.badge.blue {
    background: rgba(80, 82, 219, 0.08);
    color: #3b3dbf;
    border-color: rgba(80, 82, 219, 0.2);
}

/* Hero Section */
.portfolio-hero {
    position: relative;
    padding: 3.5rem 2rem;
    background: radial-gradient(circle at top right, rgba(246, 76, 114, 0.04), transparent 45%),
                radial-gradient(circle at bottom left, rgba(80, 82, 219, 0.05), transparent 45%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.portfolio-hero h1 {
    font-size: 3.2rem;
    margin-top: 0 !important;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    position: static !important;
}

.portfolio-hero p.subtitle {
    font-size: 1.2rem;
    color: #64748b;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    font-style: italic;
    position: static !important;
}

.portfolio-hero p.description {
    max-width: 800px;
    margin: 0 auto 2rem auto !important;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #475569;
    position: static !important;
}

/* Project Info Grid */
.hero-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.meta-item {
    text-align: center;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

/* Screenshot Showcase Carousel */
.showcase-section {
    margin-bottom: 4rem;
}

.showcase-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.showcase-subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 2rem;
}

.gallery-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
}

@media (max-width: 900px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }
}

.display-area {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 10;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.display-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.display-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%); */
    padding: 1.25rem;
    color: #ffffff;
    text-align: left;
}

.display-caption h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.15rem;
    color: #f64c72;
}

.display-caption p {
    margin: 0;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.thumbnail-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

@media (max-width: 900px) {
    .thumbnail-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

.thumb-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.thumb-item:hover {
    background: #f1f5f9;
    border-color: rgba(246, 76, 114, 0.5);
}

.thumb-item.active {
    background: rgba(246, 76, 114, 0.05);
    border-color: #f64c72;
    box-shadow: 0 0 12px rgba(246, 76, 114, 0.1);
}

.thumb-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}

.thumb-desc {
    font-size: 0.75rem;
    color: #64748b;
}

/* Metric Cards Grid */
.metrics-section {
    margin-bottom: 4rem;
}

.section-divider {
    border-top: 1px solid #e2e8f0;
    margin: 3.5rem 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.metric-card::before {
    border: 3px solid #242582;
}

/* .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #242582;
    border: 1px solid #242582;
    opacity: 0;
    transition: opacity 0.3s ease;
} */

.metric-card:hover {
    transform: translateY(-4px);
    background: #f8fafc;
    border-color: rgba(36, 37, 130, 0.15);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon {
    font-size: 1.8rem;
    color: #242582;
    margin-bottom: 0.75rem;
}

.metric-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.metric-card p {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 !important;
}

/* Tabs & Content Styling */
.tabs-container {
    margin-bottom: 4rem;
}

.tabs-bar {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    color: #64748b;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-family: inherit;
}

.tab-btn:hover {
    color: #242582;
}

.tab-btn.active {
    color: #f64c72;
    border-bottom-color: #f64c72;
}

.tab-content {
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    animation: tabFadeIn 0.3s ease;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content p {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.6;
    color: #475569;
}

.tab-content ul, .tab-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: #475569;
}

.tab-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Tables in Tabs */
.weight-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.weight-table th {
    background: #f1f5f9;
    color: #242582;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid #cbd5e1;
}

.weight-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

.weight-table tr:hover {
    background: #f8fafc;
}

.weight-badge {
    background: rgba(80, 82, 219, 0.08);
    color: #242582;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-family: monospace;
}

/* Math block */
.math-block {
    background: #f1f5f9;
    border-left: 3px solid #242582;
    padding: 1rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    font-family: 'Cambria Math', 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #1e293b;
    overflow-x: auto;
    white-space: nowrap;
}

/* Code block styles */
.code-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1.25rem 0;
    overflow: hidden;
}

.code-header {
    background: #f1f5f9;
    padding: 6px 14px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-lang {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
}

.code-container pre {
    margin: 0;
    padding: 0.85rem;
    overflow-x: auto;
}

.code-container code {
    font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #1e293b;
}

/* Syntax highlight colors adjusted for light background */
.hljs-comment { color: #64748b; font-style: italic; }
.hljs-keyword { color: #d73a49; }
.hljs-string { color: #032f62; }
.hljs-number { color: #005cc5; }
.hljs-function { color: #6f42c1; }
.hljs-title { color: #e36209; }

/* Sub-section headings in tabs */
.tab-subtitle {
    font-size: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.4rem;
    margin: 1.75rem 0 0.85rem 0;
    color: #242582;
}

/* Challenges and Tech Stack style */
.challenges-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.challenge-item {
    background: #f8fafc;
    border-left: 3px solid #f64c72;
    padding: 1.25rem;
    border-radius: 0 8px 8px 0;
}

.challenge-item h4 {
    color: #1e293b;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.challenge-item p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 !important;
}

.manifest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.manifest-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.manifest-card h4 {
    color: #242582;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.manifest-card a {
    color: #242582;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-decoration-line: none;
}

.manifest-list {
    list-style: none;
    padding: 0;
}

.manifest-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #475569;
}

.manifest-list li:last-child {
    border-bottom: none;
}

.manifest-list code {
    color: #f64c72;
    font-family: monospace;
    background: rgba(246, 76, 114, 0.05);
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 6px;
}

/* Mermaid responsiveness & wrapper */
.mermaid-wrapper {
    position: relative;
    margin: 1.25rem 0;
    width: 100%;
}

.mermaid-container {
    overflow-x: auto;
    background: #f8fafc;
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    min-width: 100%;
    box-sizing: border-box;
}

.mermaid {
    color: #2d3748;
    font-family: inherit;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Expand Button */
.expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    z-index: 10;
}

.expand-btn:hover {
    background: #ffffff;
    color: #242582;
    border-color: #5052db;
    box-shadow: 0 4px 10px rgba(36, 37, 130, 0.12);
}

.expand-btn i {
    font-size: 0.85rem;
}

/* Fullscreen Overlay Modal */
.mermaid-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.mermaid-fullscreen-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mermaid-fullscreen-content {
    background: #ffffff;
    width: 92%;
    height: 88%;
    border-radius: 12px;
    padding: 1.75rem 2rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mermaid-fullscreen-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.mermaid-fullscreen-close:hover {
    color: #f64c72;
}

.mermaid-fullscreen-header {
    margin-bottom: 1rem;
    text-align: left;
}

.mermaid-fullscreen-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #242582;
    font-family: 'Outfit', sans-serif;
}

.mermaid-fullscreen-header p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

.mermaid-fullscreen-inner {
    width: 100%;
    height: calc(100% - 3.5rem);
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    box-sizing: border-box;
}

.mermaid-fullscreen-inner svg {
    max-width: 95%;
    max-height: 95%;
    width: auto !important;
    height: auto !important;
}
