/* CSS Design System for Cafeteria Queue Monitor */

:root {
    /* Color Palette */
    --primary-color: #ff6b00;       /* ウォームオレンジ */
    --primary-light: #ffedd5;     /* 薄いオレンジ背景 */
    --primary-dark: #cc5200;      /* 濃いオレンジ */
    
    --bg-color: #fbf9f6;          /* クリームホワイト */
    --card-bg: rgba(255, 255, 255, 0.9);
    
    --text-main: #2d2219;         /* 深いウォームブラウン */
    --text-muted: #786b5f;        /* くすんだブラウン */
    
    /* Congestion Colors */
    --color-free: #10b981;        /* グリーン */
    --color-free-light: #d1fae5;
    --color-normal: #f59e0b;      /* イエローオレンジ */
    --color-normal-light: #fef3c7;
    --color-busy: #ef4444;        /* レッドオレンジ */
    --color-busy-light: #fee2e2;

    /* Spacing & Borders */
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-subtle: 0 4px 20px rgba(45, 34, 25, 0.05);
    --shadow-medium: 0 10px 30px rgba(45, 34, 25, 0.08);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(255, 107, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.03);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    background-color: var(--primary-light);
    padding: 0.6rem;
    border-radius: 50%;
    animation: rotateUtensil 3s infinite ease-in-out;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* Live Badge */
.live-badge-container {
    display: flex;
    align-items: center;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fef2f2;
    color: #ef4444;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

.overview-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.menu-link-wrapper {
    margin-top: 0.75rem;
}

.menu-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.menu-link:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

/* Queue Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

/* Queue Card */
.queue-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 107, 0, 0.08);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
}

.queue-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(255, 107, 0, 0.25);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.line-tag {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--border-radius-sm);
}

.line-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-body {
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

/* Status Badge */
.status-indicator {
    display: flex;
    justify-content: flex-start;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Card States classes mapped dynamically in JS */
.status-free .status-badge {
    background-color: var(--color-free-light);
    color: var(--color-free);
}

.status-normal .status-badge {
    background-color: var(--color-normal-light);
    color: var(--color-normal);
}

.status-busy .status-badge {
    background-color: var(--color-busy-light);
    color: var(--color-busy);
}

.status-loading .status-badge {
    background-color: #f3f4f6;
    color: #9ca3af;
}

.status-closed .status-badge {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-stale .status-badge {
    background-color: #fef3c7;
    color: #92400e;
}

/* Visualization (Queue Representation) */
.queue-visualization {
    background-color: #f7f5f2;
    border-radius: var(--border-radius-md);
    height: 70px;
    padding: 0.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
}

.visualization-track {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.visualization-bar {
    height: 100%;
    width: 0%; /* Dynamic in JS */
    border-radius: var(--border-radius-sm);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.15;
    position: absolute;
    top: 0;
    left: 0;
}

.status-free .visualization-bar {
    background-color: var(--color-free);
}

.status-normal .visualization-bar {
    background-color: var(--color-normal);
}

.status-busy .visualization-bar {
    background-color: var(--color-busy);
}

.status-closed .visualization-bar {
    background-color: #9ca3af;
}

.status-stale .visualization-bar {
    background-color: #d97706;
}

/* Icons within visualization track representing people */
.vis-icon-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    gap: 6px;
    z-index: 2;
}

.vis-person {
    font-size: 1.25rem;
    opacity: 0;
    transform: scale(0.5);
    animation: popIn 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-free .vis-person {
    color: var(--color-free);
}

.status-normal .vis-person {
    color: var(--color-normal);
}

.status-busy .vis-person {
    color: var(--color-busy);
}

.status-closed .vis-person {
    color: #9ca3af;
}

.status-stale .vis-person {
    color: #d97706;
}

/* Stats Row */
.stats-row {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    padding-top: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-value small {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Card Footer */
.card-footer {
    background-color: #faf8f5;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 107, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Tips Section */
.tips-section {
    background-color: #ffffff;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 107, 0, 0.1);
    box-shadow: var(--shadow-subtle);
}

.tips-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    padding: 1.25rem;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-color);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.tip-status {
    font-weight: 800;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.tip-status.status-free {
    color: var(--color-free);
}

.tip-status.status-normal {
    color: var(--color-normal);
}

.tip-status.status-busy {
    color: var(--color-busy);
}

.tip-status.status-closed {
    color: #6b7280;
}

.tip-status.status-stale {
    color: #d97706;
}

.tip-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 107, 0, 0.05);
    background-color: #ffffff;
    margin-top: auto;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.9);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes rotateUtensil {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(15deg);
    }
}

@keyframes popIn {
    to {
        opacity: 0.85;
        transform: scale(1);
    }
}

/* Responsive adjust */
@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
}
