@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1a237e;
    --accent: #f9a825;
    --white: #ffffff;
    --gray-100: #f5f5f5;
    --gray-200: #e0e0e0;
    --gray-600: #757575;
    --gray-800: #424242;
    --success: #4caf50;
    --danger: #f44336;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    min-height: 100vh;
    color: var(--gray-800);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

.card-center {
    max-width: 480px;
    margin: 0 auto;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    max-width: 120px;
    height: auto;
}

.logo-placeholder {
    width: 120px;
    height: 120px;
    background: var(--gray-200);
    border-radius: 12px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-800);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: inherit;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: #0d1642;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    font-size: 18px;
    padding: 18px 48px;
}

.btn-success:hover {
    background: #388e3c;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #d32f2f;
}

/* Register Page Specific */
.register-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.success-card {
    text-align: center;
}

.success-icon {
    color: var(--success);
    font-size: 48px;
    margin-bottom: 16px;
}

.queue-number {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin: 20px 0;
}

/* Display Page - Dark Theme */
.display-page {
    background: linear-gradient(135deg, #0a0f2c 0%, #1a237e 50%, #0d1642 100%);
    min-height: 100vh;
    padding: 30px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background orbs */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #f9a825;
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #4caf50;
    bottom: -50px;
    left: -50px;
    animation: float 25s ease-in-out infinite reverse;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: #3949ab;
    top: 50%;
    left: 50%;
    animation: float 30s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Grid pulse overlay */
.display-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.display-container {
    position: relative;
    z-index: 2;
    max-width: 1600px;
    margin: 0 auto;
}

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

.logo-glow {
    display: inline-block;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
}

.logo-glow img {
    max-width: 220px;
    height: auto;
    filter: brightness(1.2) contrast(1.1);
}

.logo-glow .logo-placeholder {
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.15);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 24px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 40px rgba(255,255,255,0.15);
}

.display-header h1 {
    color: #ffffff;
    font-size: 42px;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

/* Room Grid - 4 top, 3 bottom */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .rooms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rooms-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Cards */
.room-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.room-card:hover {
    box-shadow: 0 0 30px rgba(249, 168, 37, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(249, 168, 37, 0.3);
    transform: translateY(-2px);
}

.room-header {
    background: var(--primary);
    color: var(--white);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.room-accent {
    width: 4px;
    height: 24px;
    background: var(--accent);
    border-radius: 2px;
}

.room-title {
    font-weight: 700;
    letter-spacing: 1px;
}

.room-body {
    padding: 32px;
}

.room-body.numbers-only {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.number-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.next-row {
    opacity: 0.6;
    transform: scale(0.9);
}

.next-arrow {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.5);
}

/* Live dot */
.live-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 15px #4caf50, 0 0 30px rgba(76, 175, 80, 0.5);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Room values */
.room-value {
    font-size: 42px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease;
    letter-spacing: 1px;
}

.next-text {
    font-size: 28px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-weight: 400;
}

/* Flash animation on value change */
@keyframes flash {
    0% { color: #ffffff; text-shadow: 0 0 0 transparent; }
    30% { color: #f9a825; text-shadow: 0 0 20px rgba(249, 168, 37, 0.8); }
    100% { color: #ffffff; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
}

.flash {
    animation: flash 0.6s ease-out;
}

/* Admin Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 24px;
}

.error-message {
    background: #ffebee;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Admin Dashboard */
.dashboard-page {
    background: var(--gray-100);
    min-height: 100vh;
}

.dashboard-header {
    background: var(--primary);
    color: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.dashboard-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.serving-panel {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.serving-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.serving-number {
    font-size: 64px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 12px;
}

.serving-name {
    font-size: 28px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.serving-phone {
    font-size: 18px;
    color: var(--gray-600);
}

.empty-state {
    color: var(--gray-600);
    font-size: 20px;
    padding: 40px;
}

.next-btn-container {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .rooms-grid {
        grid-template-columns: 1fr;
    }
    
    .queue-number {
        font-size: 56px;
    }
    
    .serving-number {
        font-size: 48px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .card {
        padding: 24px;
    }
}
