*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-900: #0a1628;
    --brand-800: #0d2044;
    --brand-700: #0f3460;
    --brand-600: #1565c0;
    --brand-500: #1976d2;
    --brand-400: #2196f3;
    --brand-300: #42a5f5;
    --brand-200: #90caf9;
    --brand-100: #e3f2fd;
    --accent-gold: #ffd54f;
    --accent-green: #66bb6a;
    --accent-red: #ef5350;
    --accent-purple: #ab47bc;
    --accent-teal: #26c6da;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.15);
    --surface: rgba(255, 255, 255, 0.10);
    --surface-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #e8f4fd;
    --text-secondary: rgba(232, 244, 253, 0.7);
    --text-muted: rgba(232, 244, 253, 0.45);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
    --shadow-md: 0 4px 20px rgba(0,0,0,.35);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.45);
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --header-h: 100px;
    --gap: 14px;
    --p: 14px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--brand-900);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(21, 101, 192, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 85% 90%, rgba(33, 150, 243, 0.35) 0%, transparent 70%),
        linear-gradient(135deg, #050e1f 0%, #0a1c3a 50%, #0b2a52 100%);
}

.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(circle at 15% 30%, rgba(21,101,192,.18) 0%, transparent 50%),
        radial-gradient(circle at 85% 70%, rgba(33,150,243,.12) 0%, transparent 50%);
    animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    from { opacity: .6; }
    to   { opacity: 1; }
}

.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: .5; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: linear-gradient(135deg,
        rgba(13, 32, 68, 0.96) 0%,
        rgba(15, 52, 96, 0.96) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md), 0 1px 0 rgba(255,255,255,.05);
    overflow: hidden;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 4px;
    min-height: 72px;
}

.header-logos {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-sifast {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
}

.logo-np {
    height: 34px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    filter: brightness(1.1);
}

.header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.site-title {
    font-size: clamp(13px, 2.2vw, 22px);
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--white);
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(33,150,243,.4);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clock-badge {
    display: inline-block;
    font-size: clamp(11px, 1.4vw, 14px);
    font-weight: 500;
    color: var(--brand-200);
    background: rgba(33,150,243,.15);
    border: 1px solid rgba(33,150,243,.3);
    padding: 2px 12px;
    border-radius: 20px;
    letter-spacing: .5px;
}

.marquee-bar {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(21,101,192,.35), rgba(33,150,243,.2), rgba(21,101,192,.35));
    border-top: 1px solid rgba(255,255,255,.08);
    height: 28px;
    display: flex;
    align-items: center;
}

.marquee-inner {
    display: inline-flex;
    white-space: nowrap;
    animation: marquee 120s linear infinite;
    font-size: 12px;
    color: var(--brand-200);
    letter-spacing: .5px;
    padding: 0 20px;
    gap: 0;
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.main-content {
    display: grid;
    gap: var(--gap);
    padding: var(--gap);
    min-height: calc(100vh - var(--header-h));
    grid-template-columns: 350px 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "rooms  slideshow  video"
        "rooms  slideshow  upcoming";
}

.panel {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: box-shadow .3s ease;
}

.panel:hover {
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(33,150,243,.2);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px var(--p);
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(90deg, rgba(255,255,255,.05), transparent);
    flex-shrink: 0;
}

.panel-icon {
    font-size: 18px;
    line-height: 1;
    color: var(--brand-300);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-title {
    flex: 1;
    font-size: clamp(12px, 1.3vw, 15px);
    font-weight: 700;
    letter-spacing: .4px;
    color: var(--white);
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 0 0 rgba(102,187,106,.6);
    animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(102,187,106,.6); }
    70%  { box-shadow: 0 0 0 8px rgba(102,187,106,0); }
    100% { box-shadow: 0 0 0 0 rgba(102,187,106,0); }
}

.agenda-pager {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.panel-rooms {
    grid-area: rooms;
}

.rooms-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--p);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.rooms-list::-webkit-scrollbar { width: 4px; }
.rooms-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.room-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 10px 12px;
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    border-radius: var(--r-md) 0 0 var(--r-md);
    background: var(--brand-400);
    transition: background .3s ease;
}

.room-card:hover {
    transform: translateX(3px);
    background: var(--surface-hover);
    box-shadow: var(--shadow-sm);
}

.room-card.occupied::before  { background: var(--accent-gold); }
.room-card.available::before { background: var(--accent-green); }

.room-card .room-name {
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.room-card .room-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.room-card .status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: .5px;
}

.status-badge.occupied {
    background: rgba(255,213,79,.2);
    color: var(--accent-gold);
    border: 1px solid rgba(255,213,79,.4);
}

.status-badge.available {
    background: rgba(102,187,106,.18);
    color: var(--accent-green);
    border: 1px solid rgba(102,187,106,.35);
}

.room-card .room-activities {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.room-activity-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
}

.room-activity-name {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.room-activity-time {
    color: var(--brand-300);
    white-space: nowrap;
    font-size: 10px;
    flex-shrink: 0;
}

.room-no-activity {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.panel-slideshow {
    grid-area: slideshow;
}

.slideshow-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--p);
    gap: 10px;
}

.slide-main {
    flex: 1;
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--brand-800);
    min-height: 0;
}

.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .6s ease;
}

.slide-img.fading {
    opacity: 0;
}

.slide-overlay-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(5,14,31,.85), transparent);
    pointer-events: none;
}

.slide-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 14px;
    font-size: clamp(10px, 1.1vw, 13px);
    color: #fff;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    z-index: 1;
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
    transition: opacity .5s ease;
}

.slide-thumbs {
    display: flex;
    gap: 8px;
    height: 70px;
    flex-shrink: 0;
}

.slide-thumb {
    flex: 1;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .3s, transform .3s;
    opacity: .55;
}

.slide-thumb.active {
    border-color: var(--brand-400);
    opacity: 1;
    transform: scaleY(1.04);
}

.slide-thumb:hover {
    opacity: .85;
}

.slide-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.slide-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    transition: background .3s, transform .3s;
    cursor: pointer;
}

.slide-dot.active {
    background: var(--brand-400);
    transform: scale(1.3);
}

.panel-video {
    grid-area: video;
}

.video-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.panel-upcoming {
    grid-area: upcoming;
}

.agenda-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    padding: var(--p);
    overflow: hidden;
}

.agenda-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: transform .25s ease, background .25s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
    animation: fadeSlideIn .4s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.agenda-card:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
}

.agenda-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--r-md) var(--r-md) 0 0;
    background: var(--brand-400);
}

.agenda-card.rinjani::after       { background: #ffd54f; }
.agenda-card.anak-dara::after     { background: #66bb6a; }
.agenda-card.bao-ritip::after     { background: #26c6da; }
.agenda-card.sempana::after       { background: #f06292; }
.agenda-card.pergasingan::after   { background: #ba68c8; }
.agenda-card.lembah-gedong::after { background: #ffa726; }
.agenda-card.kondo::after         { background: #5c6bc0; }

.agenda-card h4 {
    font-size: clamp(9px, .95vw, 11px);
    font-weight: 700;
    color: var(--brand-300);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-card p {
    font-size: clamp(10px, 1vw, 12px);
    color: var(--text-primary);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    flex: 1;
}

.agenda-card .agenda-datetime {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.agenda-card .agenda-date {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.agenda-card .agenda-time {
    font-size: 10px;
    color: var(--brand-300);
}

.agenda-empty {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin: auto;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,.05) !important;
}

.skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,.07) 50%,
        transparent 100%);
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 1023px) and (min-width: 768px) {
    :root { --gap: 12px; --p: 12px; }

    .main-content {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "rooms     upcoming"
            "slideshow slideshow"
            "video     video";
    }

    .panel-rooms   { max-height: 340px; }
    .panel-upcoming{ max-height: 340px; }

    .agenda-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, auto);
    }

    .site-title { font-size: clamp(12px, 2vw, 18px); }
}

@media (max-width: 767px) {
    :root {
        --gap: 10px;
        --p: 10px;
        --header-h: 90px;
    }

    body { overflow-y: auto; overflow-x: hidden; }

    .main-content {
        display: flex;
        flex-direction: column;
        min-height: unset;
        padding-bottom: 20px;
    }

    .panel-rooms    { order: 1; }
    .panel-upcoming { order: 2; }
    .panel-slideshow{ order: 3; }
    .panel-video    { order: 4; }

    .panel-rooms { max-height: none; }

    .rooms-list {
        flex-direction: column;
        overflow: hidden;
        padding-bottom: 6px;
    }

    .rooms-list .room-card {
        display: none;
        min-width: unset;
        flex-shrink: 1;
        animation: roomSlideIn .4s ease;
    }
    .rooms-list .room-card.room-visible {
        display: block;
    }

    @keyframes roomSlideIn {
        from { opacity: 0; transform: translateX(-12px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    .room-card::before {
        width: 4px; height: 100%;
        border-radius: var(--r-md) 0 0 var(--r-md);
    }

    .rooms-pager {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
        padding: 6px 0 8px;
    }
    .rooms-pager-dot {
        width: 6px; height: 6px;
        border-radius: 50%;
        background: rgba(255,255,255,.25);
        transition: background .3s, transform .3s;
    }
    .rooms-pager-dot.active {
        background: var(--brand-400);
        transform: scale(1.35);
    }

    .agenda-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
    }

    .slideshow-wrapper { min-height: 260px; }
    .slide-main { flex: none; height: 200px; }
    .slide-thumbs { height: 54px; }

    .panel-video { height: auto; }
    .video-wrapper {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
        border-radius: 0 0 var(--r-lg) var(--r-lg);
    }
    .video-wrapper iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .site-title {
        font-size: clamp(11px, 3vw, 14px);
        white-space: normal;
        line-height: 1.2;
    }

    .logo-sifast { width: 36px; height: 36px; }
    .logo-np { height: 26px; max-width: 120px; }
    .clock-badge { font-size: 10px; }

    .marquee-bar { height: 24px; }
    .marquee-inner { font-size: 11px; }
}

@media (min-width: 1600px) {
    :root { --gap: 18px; --p: 18px; }
    .main-content {
        grid-template-columns: 380px 1fr 1.2fr;
    }
    .site-title { font-size: 24px; }
}

@media (max-width: 900px) and (orientation: landscape) {
    :root { --gap: 8px; --p: 8px; }

    .main-content {
        display: grid !important;
        flex-direction: unset !important;
        grid-template-columns: 260px 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        grid-template-areas:
            "rooms  slideshow  video"
            "rooms  slideshow  upcoming";
        min-height: calc(100vh - 90px);
    }

    .panel-rooms    { order: unset; }
    .panel-upcoming { order: unset; }
    .panel-slideshow{ order: unset; }
    .panel-video    { order: unset; }

    .rooms-list {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        flex-wrap: nowrap;
    }

    .room-card { min-width: unset; }
    .room-card::before { width: 4px; height: 100%; }

    .agenda-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }

    .slide-main { flex: 1; min-height: 0; height: auto; }
    .slide-thumbs { height: 50px; }

    .video-wrapper {
        padding-bottom: 0;
        height: 100%;
        position: relative;
    }
}