/*
================================================================================
AI-Assisted Programming Course - Custom Theme
Enhanced with Reveal.js best practices for optimal responsive design
Following Context7 recommendations for slide structure and organization
================================================================================
*/

:root {
    --primary-color: #2563eb; /* A vibrant, professional blue */
    --secondary-color: #4f46e5; /* A complementary indigo */
    --accent-color: #f9fafb; /* A very light gray for backgrounds */
    --text-color: #374151; /* Dark gray for readability */
    --heading-color: #111827; /* Near-black for headings */
    --border-color: #e5e7eb; /* Light gray for borders */
    --shadow-color: rgba(0, 0, 0, 0.08);
    --success-color: #16a34a; /* Green for pros/success */
    --warning-color: #dc2626; /* Red for cons/warnings */
}

/* 
================================================================================
REVEAL.JS FRAMEWORK OPTIMIZATIONS
Following official Reveal.js patterns for content organization
================================================================================
*/

/* Enhanced responsive base styles */
.reveal .slides section {
    text-align: left;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.4;
}

.reveal .slides section[data-state="title"] {
    text-align: center;
}

/* Responsive heading styles */
.reveal h1 {
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    line-height: 1.2 !important;
}

.reveal h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem) !important;
    line-height: 1.3 !important;
    margin-bottom: clamp(1rem, 2vw, 1.5rem) !important;
}

.reveal h3 {
    font-size: clamp(1.2rem, 3vw, 1.8rem) !important;
    line-height: 1.3 !important;
    margin-bottom: clamp(0.8rem, 1.5vw, 1.2rem) !important;
}

/* Title Slide Styling with responsive enhancements */
.title-slide h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-color);
    margin-bottom: 1.5rem;
    opacity: 0.8;
    line-height: 1.4;
}

.instructor-info {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text-color);
    opacity: 0.7;
}

.section-divider {
    width: min(100px, 20vw);
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    margin: 2rem auto;
    border-radius: 2px;
}

/* Professional list styling with responsive sizing */
.reveal ul li::marker {
    color: var(--primary-color);
}

.reveal ul li {
    padding-left: 0.3rem;
    margin-bottom: 0.4rem;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.4;
}

/* Responsive image enhancements */
.reveal img {
    border-radius: 12px;
    box-shadow: 0 8px 16px var(--shadow-color);
    max-width: 100%;
    height: auto;
    min-width: 200px; /* Prevent images from becoming too small */
}

/* Enhanced quote styling with responsive design */
.professional-quote {
    background: var(--accent-color);
    border-left: 5px solid var(--primary-color);
    padding: clamp(1rem, 3vw, 2rem) clamp(1.2rem, 4vw, 2rem);
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    line-height: 1.5;
    position: relative;
}

.professional-quote::before {
    content: '"';
    font-size: clamp(2.5em, 6vw, 4em);
    color: var(--primary-color);
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

/* Reveal.js Layout Helper Classes - Global styles for all slides */
.r-fit-text {
    /* Allow Reveal.js to automatically size text to fit container */
    white-space: nowrap;
    overflow: visible;
}

.r-stretch {
    /* Make element fill available vertical space */
    height: auto !important;
    max-height: 100% !important;
}

.r-hstack {
    /* Horizontal stack with responsive behavior */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 2rem);
    align-items: flex-start;
    justify-content: center;
}

.r-hstack > * {
    flex: 1 1 0px;
    min-width: 0;
}

.r-vstack {
    /* Vertical stack */
    display: flex;
    flex-direction: column;
    gap: clamp(0.8rem, 2vw, 1.2rem);
    align-items: center;
}

/* Responsive grid layout */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 3vw, 2rem);
}

/* Responsive table styling */
.comparison-table {
    font-size: clamp(0.8rem, 2vw, 1rem);
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: clamp(0.6rem, 2vw, 1rem) clamp(0.5rem, 1.5vw, 0.8rem);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive stat cards */
.stat-card {
    padding: clamp(1rem, 3vw, 1.8rem) clamp(0.8rem, 2vw, 1.5rem);
    text-align: center;
    background: var(--accent-color);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.stat-number {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Assessment card styling */
.assessment-card {
    background: var(--accent-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: clamp(1rem, 3vw, 1.5rem);
    text-align: center;
    transition: all 0.3s ease;
    min-width: 0; /* Prevent grid overflow */
}

.assessment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.assessment-title {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.assessment-weight {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
    font-weight: 800;
    color: var(--secondary-color);
    margin: 0.5rem 0;
    line-height: 1.2;
}

.week-info {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: var(--text-color);
    opacity: 0.8;
}

/* Responsive grid improvements - following Reveal.js patterns */
@media (max-width: 768px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
    
    .grid-2-col > div {
        margin-bottom: 1.5rem;
    }
    
    .grid-2-col > div:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Mobile optimizations for layout helpers */
    .r-hstack {
        flex-direction: column;
        gap: clamp(1rem, 2vw, 1.5rem);
    }
    
    .r-hstack > * {
        flex: none;
        width: 100%;
    }
    
    .r-fit-text {
        white-space: normal;
        line-height: 1.2;
    }
    
    /* Better responsive handling for inline grids */
    div[style*="grid-template-columns"] {
        display: block !important;
    }
    
    div[style*="grid-template-columns"] > div {
        margin-bottom: 1.5rem;
    }
    
    div[style*="grid-template-columns"] > div:last-child {
        margin-bottom: 0;
    }
}

/* Mobile specific adjustments */
@media (max-width: 480px) {
    .reveal img {
        min-width: 150px;
    }
    
    .professional-quote {
        margin: 1rem 0;
    }
    
    .section-divider {
        width: 60px;
        margin: 1.5rem auto;
    }
}

/* Mermaid diagram styling for better PDF rendering */
.mermaid {
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    text-align: center;
    margin: 1rem auto;
    max-width: 100%;
}

.mermaid svg {
    max-width: 100% !important;
    height: auto !important;
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
}

/* Ensure Mermaid nodes have proper spacing in PDF */
.mermaid .node {
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    fill: #374151 !important;
}

/* Override any Reveal.js styles that might interfere with Mermaid */
@media print {
    .mermaid {
        font-family: Arial, sans-serif !important;
        font-size: 12px !important;
        break-inside: avoid;
    }

    .mermaid svg {
        max-width: 100% !important;
        height: auto !important;
        font-family: Arial, sans-serif !important;
        font-size: 12px !important;
    }
}