:root {
    --bg-color: #0f1115;
    --card-bg: rgba(22, 25, 33, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-green: #10b981;
    --glow-color: rgba(239, 68, 68, 0.15);
    
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Kanit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.4;
}

/* Loader Screen */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    text-align: center;
}
.loader-icon {
    width: 4rem; height: 4rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
    animation: alertPulse 1.5s infinite;
}
.loader-text {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}
.progress-bar {
    width: 250px; height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}
.progress-fill {
    height: 100%;
    background: var(--accent-green);
    width: 0%;
    animation: loadProgress 1s ease-in-out forwards;
}
@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Background Effects */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.background-glow {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--glow-color) 0%, rgba(15, 17, 21, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    animation: pulseGlow 8s infinite alternate ease-in-out;
}

.background-glow-2 {
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(15, 17, 21, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    animation: pulseGlow 10s infinite alternate-reverse ease-in-out;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Real-time Clock */
.time-display {
    position: fixed;
    top: 1.5rem; right: 2rem;
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes alertPulse {
    0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.6); }
    100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    animation: alertPulse 2s infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.alert-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.header h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-family: var(--font-heading);
    font-weight: 300;
}

/* Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.span-full {
    grid-column: 1 / -1;
}

/* Cards (Glassmorphism) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.icon-warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-yellow); }
.icon-info { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.icon-danger { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.icon-critical { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.icon-summary { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }

.card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
}

/* Emergency Number Display */
.card-emergency {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.1), rgba(22, 25, 33, 0.8));
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15);
}
.card-emergency:hover {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.25);
}

.emergency-number {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-size: 2.5rem;
    font-family: monospace;
    font-weight: bold;
    color: var(--text-primary);
    position: relative;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    margin: 1rem 0;
}
.emergency-number .emergency-copy {
    position: relative;
    top: auto; right: auto; transform: none;
    margin-left: 1rem;
    width: 3.5rem; height: 3.5rem;
}
.emergency-number i {
    color: var(--accent-red);
    width: 2.5rem; height: 2.5rem;
}
@media (max-width: 768px) {
    .emergency-number {
        font-size: 1.5rem;
        padding: 0.75rem 1.25rem;
    }
    .emergency-number i {
        width: 1.5rem; height: 1.5rem;
    }
    .emergency-number .emergency-copy {
        width: 2.5rem; height: 2.5rem;
    }
}

/* Content Styles */
.quote-box {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent-blue);
    padding: 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-style: italic;
    margin-top: 1rem;
    color: #e2e8f0;
    line-height: 1.8;
}

.quote-text {
    padding-right: 3rem;
}

.copy-btn {
    position: absolute;
    top: 50%; right: 0.75rem;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    width: 2.5rem; height: 2.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    color: var(--accent-blue);
}

.action-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-list li {
    position: relative;
    padding-left: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 300;
    transition: transform 0.2s ease, color 0.2s ease;
}

.action-list li:hover {
    transform: translateX(5px);
    color: #fff;
}

.action-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
}

.highlight {
    color: var(--accent-blue);
    font-weight: 500;
}

.critical-text {
    color: var(--accent-red);
    font-weight: 600 !important;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

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

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

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.rule-item:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.rule-item i {
    flex-shrink: 0;
    color: var(--accent-green);
}

.rule-item p {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 0.95rem;
}

@keyframes criticalPulse {
    0% { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
    50% { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.5); box-shadow: inset 0 0 15px rgba(239,68,68,0.2); }
    100% { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
}

.rule-item.critical-rule {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    animation: criticalPulse 2.5s infinite;
}
.rule-item.critical-rule:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.3);
}
.rule-item.critical-rule i {
    color: var(--accent-red);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .time-display {
        position: static;
        display: inline-block;
        margin: 0 auto 1.5rem auto;
        font-size: 1rem;
        padding: 0.35rem 0.75rem;
    }

    .container {
        padding: 1.5rem 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header {
        margin-bottom: 2rem;
        width: 100%;
    }

    .header h1 {
        font-size: 2rem;
        line-height: 1.25;
    }

    .subtitle {
        font-size: 1rem;
    }

    .alert-badge {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }

    .grid-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        width: 100%;
    }

    .card {
        padding: 1.25rem;
        border-radius: 1rem;
    }

    .card h2 {
        font-size: 1.1rem;
    }

    .quote-box {
        padding: 1rem;
        font-size: 1rem;
    }

    .quote-text {
        padding-right: 0;
        margin-bottom: 0.75rem;
    }

    .copy-btn {
        position: static;
        transform: none;
        width: 100%;
        height: 2.75rem;
        margin-top: 0.5rem;
    }

    .emergency-number {
        font-size: 1.35rem;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 0.5rem;
    }

    .emergency-number .emergency-copy {
        margin-left: 0;
        width: 2.75rem;
        height: 2.75rem;
    }

    .critical-text {
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }

    .rules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rule-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .emergency-number {
        font-size: 1.2rem;
    }
}
