/*
 * Custom CSS for CMSC 178IP Presentations
 * Image Processing - University of the Philippines Cebu
 * Department of Computer Science
 */

/* Image Processing Color Palette */
:root {
    --ip-primary: #0284C7;      /* Sky blue - imaging, processing */
    --ip-secondary: #7C3AED;    /* Purple - transforms, frequency */
    --ip-accent: #06B6D4;       /* Cyan - digital, pixels */
    --ip-warning: #F59E0B;      /* Amber - attention, caution */
    --ip-dark: #1E293B;         /* Slate dark - backgrounds */
    --ip-light: #F0F9FF;        /* Sky light - backgrounds */
    --up-maroon: #7b1113;       /* UP branding */
    --up-gold: #ffd700;         /* UP branding */
    --text-dark: #1E293B;
    --text-light: #64748B;
    --header-bg: #0284C7;
    --header-bg-dark: #0369A1;
}

/* ===========================================
   Header Bar (Fixed at top)
   =========================================== */
body {
    margin: 0;
    padding: 0;
}

.presenter-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--ip-primary) 0%, var(--ip-accent) 100%);
    color: white;
    padding: 8px 16px;
    border-bottom: 3px solid var(--up-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(2, 132, 199, 0.3);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.presenter-header h1 {
    font-size: 0.95em;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white !important;
    border: none !important;
    padding: 0 !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.home-button {
    background: var(--up-gold);
    color: var(--ip-dark);
    border: none;
    padding: 6px 12px;
    font-size: 0.75em;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.home-button:hover {
    background: white;
    color: var(--ip-primary);
    transform: translateY(-1px);
}

.home-button svg {
    width: 14px;
    height: 14px;
}

.course-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.course-badge svg {
    opacity: 0.9;
}

.slide-counter {
    font-size: 0.9em;
    color: var(--up-gold);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 6px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.header-btn svg {
    width: 18px;
    height: 18px;
}

/* ===========================================
   Base typography (with header offset)
   =========================================== */
.reveal {
    margin-top: 50px !important;
    height: calc(100vh - 50px) !important;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 28px;
    color: var(--text-dark);
}

.reveal h1, .reveal h2, .reveal h3 {
    font-weight: 700;
    color: var(--ip-primary);
    text-transform: none;
    letter-spacing: -0.02em;
}

.reveal h1 {
    font-size: 2.2em;
    margin-bottom: 0.5em;
}

.reveal h2 {
    font-size: 1.6em;
    margin-bottom: 0.4em;
    border-bottom: 4px solid var(--ip-secondary);
    padding-bottom: 0.2em;
    display: inline-block;
}

.reveal h3 {
    font-size: 1.3em;
    color: var(--ip-secondary);
}

.reveal h4 {
    color: var(--ip-primary);
    margin-top: 0;
    font-size: 1.1em;
}

/* ===========================================
   Layout: Columns
   =========================================== */
.two-columns, .two-column, .two-col {
    display: flex;
    gap: 2em;
    align-items: flex-start;
}

.two-columns > div, .two-column > div, .two-col > div {
    flex: 1;
    text-align: left;
}

.column {
    flex: 1;
    text-align: left;
}

.three-columns {
    display: flex;
    gap: 1.5em;
    align-items: flex-start;
}

.three-columns > div {
    flex: 1;
    text-align: left;
}

/* Image + Text layouts */
.image-text-layout, .side-by-side-layout {
    display: flex;
    gap: 2em;
    align-items: center;
}

.image-text-layout > div, .side-by-side-layout > div {
    flex: 1;
}

.image-column {
    flex: 1;
    text-align: center;
}

.text-column {
    flex: 1;
    text-align: left;
}

.text-row {
    text-align: left;
    margin-bottom: 1em;
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 1.2em;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.info-card h4 {
    margin-top: 0;
}

/* ===========================================
   Lists
   =========================================== */
.reveal ul, .reveal ol {
    text-align: left;
    margin-left: 1em;
}

.reveal li {
    margin-bottom: 0.3em;
    line-height: 1.4;
}

.reveal li::marker {
    color: var(--ip-primary);
}

/* ===========================================
   Content Boxes
   =========================================== */

/* Key point */
.key-point {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border-left: 5px solid var(--ip-primary);
    padding: 1em 1.5em;
    border-radius: 0 12px 12px 0;
    text-align: left;
    margin: 0.5em 0;
}

/* Highlight box (both class names) */
.highlight, .highlight-box {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border: 2px solid var(--ip-primary);
    padding: 1em 1.5em;
    border-radius: 12px;
    text-align: left;
    margin: 0.5em 0;
}

/* Definition (both class names) */
.definition, .definition-box {
    background: linear-gradient(135deg, #F5F3FF 0%, #FDF4FF 100%);
    border: 2px solid var(--ip-secondary);
    padding: 1em 1.5em;
    border-radius: 12px;
    text-align: left;
    margin: 0.5em 0;
}

/* Formula box */
.formula-box {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 2px solid var(--ip-warning);
    padding: 1em 1.5em;
    border-radius: 12px;
    text-align: center;
    margin: 0.5em 0;
}

/* Warning */
.warning {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left: 5px solid var(--ip-warning);
    padding: 1em 1.5em;
    border-radius: 0 12px 12px 0;
    text-align: left;
    margin: 0.5em 0;
}

/* Example */
.example {
    background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%);
    border: 2px solid var(--ip-accent);
    padding: 1em 1.5em;
    border-radius: 12px;
    text-align: left;
    margin: 0.5em 0;
}

/* Info */
.info {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border-left: 5px solid var(--ip-accent);
    padding: 1em 1.5em;
    border-radius: 0 12px 12px 0;
    text-align: left;
    margin: 0.5em 0;
}

/* Callout */
.callout {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 2px solid #CBD5E1;
    padding: 1.5em;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0.5em 0;
}

.callout-title {
    color: var(--ip-primary);
    font-weight: 700;
    margin-bottom: 0.5em;
}

/* Algorithm box */
.algorithm {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.2em 1.5em;
    border-radius: 12px;
    text-align: left;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8em;
    margin: 0.5em 0;
    border: 2px solid var(--ip-primary);
}

/* Success box */
.success-box {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: 2px solid #10B981;
    padding: 1em 1.5em;
    border-radius: 12px;
    text-align: left;
}

/* Case study box */
.case-study-box {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 2px solid #CBD5E1;
    padding: 1.5em;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.case-study-box h4 {
    color: var(--ip-primary);
    margin-top: 0;
}

/* ===========================================
   Math Display
   =========================================== */
.math-block, .math-display {
    font-size: 1.2em;
    margin: 0.8em 0;
    color: var(--ip-dark);
    text-align: center;
}

/* ===========================================
   Code Blocks
   =========================================== */
.reveal pre {
    width: 100%;
    font-size: 0.65em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.reveal code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.reveal pre code {
    padding: 1.2em;
    max-height: 450px;
    background: #1e1e1e;
    border-radius: 12px;
}

/* Inline code */
.reveal p code, .reveal li code {
    background: var(--ip-light);
    color: var(--ip-primary);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.code-block, .code-example {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1em 1.5em;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75em;
    text-align: left;
    overflow-x: auto;
    margin: 0.5em 0;
}

.code-output {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1em;
    border-radius: 0 0 12px 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75em;
    margin-top: -12px;
    border-top: 2px dashed #3c3c3c;
}

.code-output::before {
    content: "Output:";
    display: block;
    color: #6A9955;
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* ===========================================
   Images & Figures
   =========================================== */
.reveal img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.reveal section img {
    max-height: 60vh;
    object-fit: contain;
}

.caption {
    font-size: 0.7em;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5em;
}

.figure, .slide-figure {
    text-align: center;
    margin: 0.5em 0;
}

.figures-row {
    display: flex;
    gap: 1em;
    justify-content: center;
    align-items: flex-start;
}

.figures-row > * {
    flex: 1;
    text-align: center;
}

/* ===========================================
   Tables
   =========================================== */
.reveal table, .info-table, .comparison-table {
    margin: 1em auto;
    border-collapse: collapse;
    font-size: 0.85em;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reveal table th {
    background: linear-gradient(135deg, var(--ip-primary) 0%, var(--ip-accent) 100%);
    color: white;
    padding: 0.7em 1em;
    font-weight: 600;
}

.reveal table td {
    padding: 0.5em 1em;
    border: 1px solid #e2e8f0;
}

.reveal table tr:nth-child(even) {
    background-color: var(--ip-light);
}

.reveal table tr:hover {
    background-color: #E0F2FE;
}

/* ===========================================
   Color Utility Classes
   =========================================== */
.blue { color: var(--ip-primary); }
.green { color: #10B981; }
.purple { color: var(--ip-secondary); }
.yellow { color: var(--ip-warning); }
.pink { color: #EC4899; }

/* ===========================================
   Knowledge Check
   =========================================== */
.knowledge-check {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 3px solid var(--ip-warning);
    border-radius: 16px;
    padding: 1.5em 2em;
    text-align: left;
}

.knowledge-check h4 {
    color: #B45309;
    margin-top: 0;
}

.knowledge-check .answer {
    margin-top: 1em;
    padding: 1em;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid var(--ip-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.knowledge-check .answer.hidden {
    opacity: 0.5;
    filter: blur(4px);
}

.knowledge-check .answer:hover {
    opacity: 1;
    filter: none;
}

.knowledge-check .reveal-hint {
    font-size: 0.75em;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.5em;
}

/* ===========================================
   Icon styling (Font Awesome integration)
   =========================================== */
.icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ip-light);
    border-radius: 6px;
    color: var(--ip-primary);
}

/* ===========================================
   Stat Cards
   =========================================== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.2em;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.stat-card .stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--ip-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8em;
    color: var(--text-light);
    margin-top: 0.3em;
}

/* ===========================================
   Activity & Discussion Boxes
   =========================================== */
.activity-box {
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    border: 3px solid var(--ip-primary);
    border-radius: 16px;
    padding: 1.5em 2em;
    text-align: left;
}

.activity-box h4 {
    color: var(--ip-primary);
    margin-top: 0;
}

.discussion-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 3px solid var(--ip-warning);
    border-radius: 16px;
    padding: 1.5em 2em;
    text-align: left;
}

.discussion-box h4 {
    color: #B45309;
    margin-top: 0;
}

/* ===========================================
   Progress bar
   =========================================== */
.reveal .progress {
    background: rgba(0, 0, 0, 0.2);
    height: 4px;
}

.reveal .progress span {
    background: linear-gradient(90deg, var(--ip-primary) 0%, var(--ip-accent) 100%);
    transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
}

/* Slide numbers */
.reveal .slide-number {
    font-size: 14px;
    color: var(--text-light);
    background-color: transparent;
}

/* Fragment animations */
.reveal .fragment.highlight-current-blue.current-fragment {
    color: var(--ip-primary);
}

/* ===========================================
   Slide overflow prevention
   =========================================== */
.reveal .slides section {
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

/* ===========================================
   Print styles
   =========================================== */
@media print {
    .presenter-header {
        display: none;
    }
    .reveal {
        margin-top: 0 !important;
        height: 100vh !important;
    }
    .reveal .slide-number {
        display: none;
    }
    .reveal section {
        page-break-after: always;
    }
}

/* ===========================================
   Mobile responsiveness
   =========================================== */
@media screen and (max-width: 768px) {
    .presenter-header {
        padding: 6px 12px;
    }
    .presenter-header h1 {
        display: none;
    }
    .course-badge span {
        display: none;
    }
    .header-left {
        gap: 10px;
    }
    .home-button span {
        display: none;
    }
    .reveal {
        font-size: 20px;
        margin-top: 45px !important;
        height: calc(100vh - 45px) !important;
    }
    .two-columns, .two-column, .two-col, .three-columns,
    .image-text-layout, .side-by-side-layout {
        flex-direction: column;
    }
    .reveal pre {
        font-size: 0.55em;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .figures-row {
        flex-direction: column;
    }
}

/* ===========================================
   Accessibility: Reduce motion
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    .reveal .slides section {
        transition: none !important;
    }
    .reveal .slide-background {
        transition: none !important;
    }
    .reveal .fragment {
        transition: none !important;
    }
    .reveal .slides section .fragment.visible {
        transition: none !important;
    }
    .reveal .slides > section,
    .reveal .slides > section > section {
        transition: none !important;
    }
}
