@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #7A6A4D;
    --accent: #c49a3c;
    --white: #ffffff;
    --gray-100: #F5F0E8;
    --gray-200: #E0D8CC;
    --gray-600: #7A7062;
    --gray-800: #3A2E26;
    --success: #5A8A7A;
    --danger: #B87333;
    --bg-display: #F5F0E8;
    --bg-card: #EDE6D6;
    --text-display: #2C4A4E;
    --text-value: #1E3A3E;
    --text-empty: #6B9A8A;
    --text-offline: #B87333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', sans-serif;
    background: var(--bg-display);
    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: #6A5A3D;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--primary);
    color: var(--white);
    font-size: 18px;
    padding: 18px 48px;
}

.btn-success:hover {
    background: #6A5A3D;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #9A6030;
}

/* 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 - Light Beige Theme */
.display-page {
    background: var(--bg-display);
    min-height: 100vh;
    padding: 30px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background orbs - subtle pastels for light theme */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #c49a3c;
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #5A8A7A;
    bottom: -50px;
    left: -50px;
    animation: float 25s ease-in-out infinite reverse;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: #2C4A4E;
    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 - subtle for light theme */
.display-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,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.15; }
    50% { opacity: 0.3; }
}

.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;
}

.logo-glow img {
    max-width: 32%;
    height: auto;
}

.logo-glow .logo-placeholder {
    width: 220px;
    height: 220px;
    background: var(--bg-card);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.display-header h1 {
    color: var(--text-display);
    font-size: 42px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* 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;
    }
}

/* Room Cards - Light Theme */
.room-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.room-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    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: var(--gray-600);
}

/* Live dot */
.live-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(90, 138, 122, 0.4);
    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: var(--text-value);
    transition: opacity 0.3s ease;
    letter-spacing: 1px;
}

.next-text {
    font-size: 28px;
    font-weight: 600;
    color: var(--gray-600);
}

.empty-state {
    color: var(--text-empty);
    font-style: italic;
    font-weight: 400;
}

/* Flash animation on value change */
@keyframes flash {
    0% { color: var(--text-value); }
    30% { color: var(--accent); }
    100% { color: var(--text-value); }
}

.flash {
    animation: flash 0.6s ease-out;
}

/* Admin Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg-display);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 24px;
}

.error-message {
    background: #fdf2e9;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Admin Dashboard */
.dashboard-page {
    background: var(--bg-display);
    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;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease;
    min-width: 250px;
    max-width: 400px;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
}

.toast button:hover {
    opacity: 1;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Confirm dialog overlay */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.confirm-box {
    background: var(--white);
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.confirm-box p {
    margin: 0 0 24px;
    font-size: 16px;
    color: var(--gray-800);
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    padding: 10px 28px;
    font-size: 14px;
}

/* 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;
    }
}
