/* ============================================================
   Reset & Base Styles
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   Header
   ============================================================ */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ============================================================
   Main Content
   ============================================================ */

.main-content {
    flex: 1;
    padding: 2rem 0;
    position: relative;
}

/* ============================================================
   Loading Overlay
   ============================================================ */

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    transition: opacity 0.3s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
}

/* ============================================================
   Iframe Container
   ============================================================ */

.iframe-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    height: 700px;
    width: 100%;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

#streamlit-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.footer p {
    color: #64748b;
    font-size: 0.9rem;
}

.footer strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 768px) {
    .header {
        padding: 1.5rem 0;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .logo-icon {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .iframe-container {
        height: 600px;
        border-radius: 8px;
    }

    .main-content {
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .iframe-container {
        height: 500px;
    }
}

/* ============================================================
   Dark Mode Support (opcional)
   ============================================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --text-color: #e2e8f0;
        --border-color: #334155;
    }

    body {
        background-color: var(--background-color);
    }

    .iframe-container {
        background: #1e293b;
        border-color: var(--border-color);
    }

    .footer {
        background-color: #1e293b;
        border-top-color: var(--border-color);
    }

    .footer p {
        color: #94a3b8;
    }
}
