:root {
    --color-primary: #FF4500;
    /* Orange Red - The "JRENG" */
    --color-secondary: #FF8C00;
    /* Dark Orange */
    --color-bg: #FFF8E7;
    /* Cosmic Latte / Cream (Vintage paper) */
    --color-text: #2c1810;
    /* Dark Brownish Text */
    --color-accent: #FFD700;
    /* Gold */
    --color-card: #ffffff;
    --shadow-retro: 4px 4px 0px #2c1810;
    --font-head: 'Rye', serif;
    --font-body: 'Courier Prime', monospace;
}

body.dark-mode {
    --color-bg: #2c1810;
    --color-text: #FFE4B5;
    --color-card: #3e2723;
    --shadow-retro: 4px 4px 0px #FF4500;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 80px;
    /* Space for nav */
    border-left: 2px solid var(--color-primary);
    border-right: 2px solid var(--color-primary);
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ff4500' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Header */
header {
    text-align: center;
    padding: 20px;
    background-color: var(--color-secondary);
    color: white;
    border-bottom: 4px solid var(--color-text);
}

.bounce-text {
    font-family: var(--font-head);
    font-size: 2rem;
    animation: bounce 2s infinite;
    text-shadow: 2px 2px 0px #000;
}

.funny-quote {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 5px;
    opacity: 0.9;
}

/* Cards */
.card {
    background: var(--color-card);
    border: 3px solid var(--color-text);
    box-shadow: var(--shadow-retro);
    margin: 20px;
    padding: 20px;
    text-align: center;
    position: relative;
}

.realtime-card {
    border-color: var(--color-primary);
}

.digital-clock {
    font-size: 3rem;
    font-weight: bold;
    color: var(--color-primary);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.subject-highlight {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-secondary);
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

/* Interactive */
.interactive-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px;
}

.retro-btn {
    background: var(--color-primary);
    color: white;
    border: 2px solid var(--color-text);
    padding: 10px 20px;
    font-family: var(--font-body);
    font-weight: bold;
    box-shadow: 2px 2px 0px var(--color-text);
    cursor: pointer;
    font-size: 0.9rem;
}

.retro-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Sections */
.hidden-section {
    display: none;
}

.active-section {
    display: block;
    animation: slideIn 0.3s ease-out;
}

/* Schedule Table */
.schedule-table-container {
    overflow-x: auto;
    margin: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: var(--color-card);
}

th,
td {
    border: 2px solid var(--color-text);
    padding: 8px;
    text-align: center;
}

th {
    background-color: var(--color-secondary);
    color: white;
}

td {
    color: var(--color-text);
}

/* Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 2px dashed var(--color-text);
    margin: 0 20px;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    /* Center relative to viewport */
    transform: translateX(-50%);
    /* Center trick */
    width: 100%;
    max-width: 600px;
    /* Match app container */
    background: var(--color-text);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 4px solid var(--color-primary);
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    /* Larger icons */
    cursor: pointer;
    font-family: var(--font-head);
}

.nav-btn.active {
    color: var(--color-primary);
    transform: scale(1.2);
}

/* Animations */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* Watermark */
.watermark {
    text-align: center;
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--color-text);
    opacity: 0.15;
    /* Samar-samar tapi keliatan */
    margin-top: 30px;
    margin-bottom: 20px;
    pointer-events: none;
    letter-spacing: 2px;
}