/**
 * Educational Slides - Base Styles
 * "Fundamentos Técnicos de IA para Abogados"
 *
 * (c) 2025 Trifolia (trifolia.cl)
 * Licensed under CC BY-NC-SA 4.0
 * https://creativecommons.org/licenses/by-nc-sa/4.0/
 *
 * Usage: Include after Bootstrap CSS in slide pages:
 *   <link href="css/slides-base.css" rel="stylesheet">
 */

/* --------------------------------------------------------------------------
   CSS Variables - Trifolia Brand Colors
   -------------------------------------------------------------------------- */

:root {
    /* Primary colors */
    --clover-purple: #3c78fd;
    --law-navy: #1A2332;
    --paper-white: #F8F9FA;
    --leaf-green: #5B7D52;
    --petal-accent: #7200fc;

    /* Gradient colors */
    --gradient-cyan: #00ffff;
    --gradient-purple: #a855f7;

    /* State colors */
    --success-green: #10B981;
    --warning-amber: #F59E0B;
    --danger-red: #EF4444;
    --error-red: #DC3545;

    /* Layout defaults (can be overridden per slide) */
    --viz-max-width: 1000px;
    --viz-padding: 40px 20px;
    --viz-padding-mobile: 24px 16px;
}

/* --------------------------------------------------------------------------
   Base Reset & Typography
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    /* Black background for letterbox/pillarbox around 16:9 slide */
    background: #000;
    color: var(--paper-white);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Page Layout
   -------------------------------------------------------------------------- */

.page-container {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main Content Container - 16:9 reference resolution */
.viz-container {
    /* Fixed reference resolution */
    width: 1280px;
    height: 720px;
    min-height: 720px;
    padding: var(--viz-padding);

    /* Scale to fit viewport */
    transform: scale(var(--slide-scale, 1));
    transform-origin: center;

    /* Slide background */
    background: linear-gradient(165deg, #0d1117 0%, var(--law-navy) 50%, #0d1420 100%);
    border-radius: 4px;
    overflow: hidden;
    flex: none;
    position: relative;
}

/* Subtle noise texture overlay */
.viz-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
}

/* Content wrapper with max-width */
.viz-content {
    max-width: var(--viz-max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Decorative Corner Elements
   -------------------------------------------------------------------------- */

.corner-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-top: 2px solid var(--clover-purple);
    border-left: 2px solid var(--clover-purple);
    opacity: 0.4;
}

.corner-bottom-right {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-bottom: 2px solid var(--petal-accent);
    border-right: 2px solid var(--petal-accent);
    opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Header Styles
   -------------------------------------------------------------------------- */

.viz-header {
    text-align: center;
    margin-bottom: 40px;
}

.viz-subtitle {
    font-size: 11px;
    letter-spacing: 5px;
    color: var(--clover-purple);
    margin-bottom: 16px;
    font-family: "Inter", system-ui, sans-serif;
    text-transform: uppercase;
    font-weight: 500;
}

.viz-title {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 400;
    margin: 0 0 16px 0;
    line-height: 1.3;
    letter-spacing: -0.5px;
    color: var(--paper-white);
}

.viz-title .highlight {
    background: linear-gradient(90deg, var(--gradient-cyan), var(--gradient-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.viz-question {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: clamp(18px, 2.5vw, 24px);
    color: rgba(248, 249, 250, 0.8);
    font-style: italic;
    margin: 0 0 24px 0;
}

.viz-description {
    font-size: 16px;
    color: rgba(248, 249, 250, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Brand Footer
   -------------------------------------------------------------------------- */

.brand-footer {
    display: none;
}

.footer-brand {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.footer-brand strong {
    color: var(--paper-white);
    font-weight: 500;
}

/* Brand Wordmark Image */

.brand-wordmark {
    display: inline-block;
    height: 1em;
    width: auto;
    vertical-align: baseline;
    position: relative;
    top: 0.1em;
}

.brand-wordmark--footer {
    height: 14px;
    top: 2px;
}

.brand-wordmark--heading {
    height: 0.85em;
    top: 0.05em;
}

.brand-wordmark--body {
    height: 0.9em;
    top: 0.12em;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--clover-purple);
    border: 1px solid var(--clover-purple);
    padding: 10px 20px;
    font-size: 14px;
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-cta:hover {
    background: var(--clover-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 120, 253, 0.3);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

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

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

@keyframes slideEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Page-enter transition for smooth navigation between slides */
.page-container {
    animation: slideEnter 0.3s ease-out;
}

/* Apply default animations to common elements */
.viz-header {
    animation: fadeIn 0.4s ease-out;
}

/* --------------------------------------------------------------------------
   Global Focus Indicators
   -------------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--clover-purple);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Accessibility - Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn-cta:hover {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Responsive - Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    /* Switch from 16:9 letterbox to native mobile layout */
    body {
        overflow-y: auto;
        overflow-x: hidden;
        background: linear-gradient(165deg, #0d1117 0%, var(--law-navy) 50%, #0d1420 100%);
        padding-bottom: 60px;
    }

    .page-container {
        position: static;
        min-height: 100vh;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    /* Hide watermark on mobile */
    .page-container::after {
        display: none;
    }

    .viz-container {
        width: 100%;
        height: auto;
        min-height: auto;
        transform: none !important;
        overflow: visible;
        border-radius: 0;
        padding: var(--viz-padding-mobile);
    }

    .corner-top-left,
    .corner-bottom-right {
        display: none;
    }

    .viz-header {
        margin-bottom: 24px;
    }

    .viz-content {
        overflow-x: hidden;
    }

    .brand-footer {
        display: flex;
        padding: 14px 16px;
    }
}

/* Stack footer on very small screens */
@media (max-width: 480px) {
    .brand-footer {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* --------------------------------------------------------------------------
   Responsive - Large Screens
   -------------------------------------------------------------------------- */

@media (min-width: 1400px) {
    .viz-title {
        font-size: 40px;
    }
}

/* --------------------------------------------------------------------------
   Trifolia Watermark Logo
   -------------------------------------------------------------------------- */

.page-container::after {
    content: "";
    position: fixed;
    bottom: 12px;
    right: 12px;
    width: 88px;
    height: 88px;
    background: url("../images/logo-trifolia-white.png") no-repeat center / contain;
    opacity: 0.25;
    pointer-events: none;
    z-index: 9999;
}
