/* ==========================================
   KIOSK MASJID - STYLESHEET LENGKAP & SELARAS
   ========================================== */

:root {
    --primary-color: #1a4d2e;
    --secondary-color: #4e9f3d;
    --accent-primary: #ff9f29;
    --accent-tech: #0284c7;
    --bg-color: #f5f7f8;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --radius-md: 10px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --base-font-scale: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* Start Screen Overlay */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), #0f2e1c);
    color: white;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.start-content {
    max-width: 500px;
    padding: 2rem;
}

.start-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.touch-start-btn {
    margin-top: 1.5rem;
    padding: 12px 24px;
    font-size: 1.1rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.brand-icon {
    font-size: 2rem;
    color: var(--accent-primary);
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.nav-item button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: #e2e8f0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-item button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active button {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header-bar {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-title h1 {
    font-size: calc(1.5rem * var(--base-font-scale));
    color: var(--primary-color);
}

.header-title p {
    font-size: calc(0.85rem * var(--base-font-scale));
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.font-scaler {
    display: flex;
    gap: 5px;
    background: var(--bg-color);
    padding: 4px;
    border-radius: 6px;
}

.font-btn {
    border: 1px solid var(--border-color);
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.clock-widget {
    text-align: right;
}

.clock-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.clock-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Tab Panels Switching (PENYELASAN UTAMA UTK SCRIPT JS) */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Cards & Layout Grid */
.grid-cards-main, .grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.card-highlight {
    border-left: 5px solid var(--accent-primary);
}

.badge-pill {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Solat Grid */
.solat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.solat-card {
    background: var(--card-bg);
    padding: 1rem;
    text-align: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.solat-card.next-solat {
    background: var(--primary-color);
    color: white;
}

.solat-name { font-weight: bold; }
.solat-time { font-size: 1.1rem; margin-top: 5px; }

/* Galeri Aktiviti */
.gallery-layout {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-hero {
    width: 300px;
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.gallery-hero img, .gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
}

/* Marquee Footer (TICKER) */
.marquee-footer {
    height: 40px;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.marquee-badge {
    background: var(--accent-primary);
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 2;
    white-space: nowrap;
}

.marquee-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Responsif Mobile & Tablet */
@media screen and (max-width: 1024px) {
    body { overflow-y: auto; height: auto; }
    .app-container { flex-direction: column; height: auto; }
    .sidebar { width: 100%; }
    .nav-menu { flex-direction: row; flex-wrap: wrap; }
    .nav-item { flex: 1 1 calc(50% - 8px); }
    .main-wrapper { height: auto; overflow: visible; }
}