/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Default (Light/Blue) - Used by theme-light */
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --primary: #0284c7;
    --secondary: #64748b;
    --accent: #d97706;
    --success: #16a34a;
    --danger: #dc2626;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(70, 70, 80, 0.1);

    --font-main: 'Outfit', sans-serif;

    --card-hover-bg: rgba(255, 255, 255, 0.8);
}

/* THEMES */

/* Dark (Premium) */
body.theme-dark {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --primary: #38bdf8;
    --secondary: #94a3b8;
    --accent: #f59e0b;
    --success: #22c55e;
    --danger: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-hover-bg: rgba(255, 255, 255, 0.1);
}

/* Nature (Green/Calming) */
body.theme-nature {
    --bg-color: #f0fdf4;
    /* Light Mint */
    --text-color: #14532d;
    --primary: #16a34a;
    --secondary: #57a878;
    --accent: #d97706;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(22, 163, 74, 0.2);
}

/* Royal (Purple/Elegant) */
body.theme-royal {
    --bg-color: #1e1b4b;
    /* Deep Indigo */
    --text-color: #e0e7ff;
    --primary: #a78bfa;
    --secondary: #818cf8;
    --accent: #fbbf24;
    --glass-bg: rgba(49, 46, 129, 0.6);
    --glass-border: rgba(167, 139, 250, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --card-hover-bg: rgba(167, 139, 250, 0.15);
}

/* Ocean (Deep Blue/Teal) */
body.theme-ocean {
    --bg-color: #083344;
    /* Cyan 950 */
    --text-color: #ecfeff;
    --primary: #22d3ee;
    --secondary: #67e8f9;
    --accent: #facc15;
    --glass-bg: rgba(22, 78, 99, 0.6);
    --glass-border: rgba(34, 211, 238, 0.2);
    --card-hover-bg: rgba(34, 211, 238, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(34, 197, 94, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: background 0.3s ease, border 0.3s ease;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    /* Always white text on primary in light mode for contrast */
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

/* Totem specific styles */
.totem-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at center, rgba(var(--primary), 0.05) 0%, transparent 70%);
}

.totem-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn Down 0.8s ease-out;
}

.totem-header h1 {
    font-size: 1.5rem;
    /* Much smaller */
    font-weight: 400;
    /* No bold */
    color: var(--text-color);
    opacity: 0.9;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.totem-header p {
    font-size: 2.5rem;
    /* Much larger */
    font-weight: 700;
    color: var(--primary);
    /* Highlight the action */
    opacity: 1;
    line-height: 1.2;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1000px;
}

.service-card {
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border-radius: 24px;
    /* More rounded */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy spring */
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.service-card:hover::before {
    opacity: 0.05;
}

.service-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    z-index: 1;
}

.service-card p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    z-index: 1;
}

.service-icon {
    font-size: 3.5rem;
    /* Larger icon but visually balanced */
    margin-bottom: 1.5rem;
    color: var(--primary);
    transition: transform 0.4s ease;
    z-index: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Reception Styles */
.reception-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    padding: 2rem;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
}

.ticket-list {
    display: grid;
    gap: 1rem;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 0.5rem;
}

.ticket-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-waiting {
    background: rgba(56, 189, 248, 0.2);
    color: var(--primary);
}

.status-called {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* Panel Styles */
.panel-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    height: 100vh;
    padding: 2rem;
    gap: 2rem;
    overflow: hidden;
}

.media-area {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.media-area iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.history-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-card {
    padding: 1.5rem;
    border-left: 4px solid var(--secondary);
    transition: all 0.3s;
}

.history-card.latest {
    border-left: 4px solid var(--success);
    /* Lighter gradient for light mode */
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1), transparent);
}

.history-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.history-meta {
    font-size: 1rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Call Overlay (Popup when calling) */
.call-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    /* Keep overlay dark for impact */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    backdrop-filter: blur(20px);
}

.call-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.call-content {
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.call-overlay.active .call-content {
    transform: scale(1);
}

.call-number {
    font-size: 12rem;
    font-weight: 900;
    background: linear-gradient(to right, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 50px rgba(56, 189, 248, 0.5));
}

.call-service {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 2rem;
}

@media print {
    body>*:not(#print-area) {
        display: none !important;
    }

    #print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        text-align: center;
        color: #000;
        padding: 5px;
        /* Reduced padding for thermal paper */
    }

    .ticket-print-header {
        font-size: 1.2rem;
        font-weight: bold;
        margin-bottom: 5px;
        text-transform: uppercase;
    }

    .ticket-print-number {
        font-size: 3.5rem;
        /* Slightly smaller to ensure fit on 58mm if needed */
        font-weight: 800;
        margin: 5px 0;
    }

    .ticket-print-meta {
        font-size: 0.8rem;
        margin-top: 5px;
    }

    /* Hide the UI elements */
    .totem-container,
    .call-overlay {
        display: none !important;
    }
}