/* =============================================================================
   Anjungan TKA Dashboard - Custom Styles
   SMP Negeri 9 Malang
   Optimized for IFP Signage (65-86" Touch Display, Full HD/4K)
   ============================================================================= */

/* ---- Base ---- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}

/* Show cursor on interaction */
body.user-active {
    cursor: default;
}

/* ---- Glass Card ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all 0.3s ease;
}
.glass-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Glass card with subtle glow on hover (IFP touch feedback) */
.glass-card-glow {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.glass-card-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.6s ease;
}
.glass-card-glow:hover::before {
    left: 100%;
}
.glass-card-glow:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.08);
}

/* ---- Navigation Buttons (IFP-optimized touch targets) ---- */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    min-height: 44px; /* Touch-friendly minimum */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.nav-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}
.nav-btn:active {
    transform: scale(0.96);
}
.nav-btn.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

/* ---- Filter Tabs ---- */
.filter-tab {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
    user-select: none;
}
.filter-tab:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}
.filter-tab.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

/* ---- Page Transition Animations ---- */
.animate-fadeIn {
    animation: fadeSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-fadeOut {
    animation: fadeSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-16px) scale(0.99);
    }
}

/* ---- Staggered entry animation for child elements ---- */
.stagger-in > * {
    opacity: 0;
    animation: staggerFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Ticker ---- */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: tickerScroll var(--ticker-duration, 30s) linear infinite;
    gap: 60px;
    padding-left: 100%;
}
.ticker-content:hover {
    animation-play-state: paused;
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #cbd5e1;
    flex-shrink: 0;
    font-weight: 500;
}
.ticker-item .ticker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ticker-dot-normal { background: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.5); }
.ticker-dot-penting { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.ticker-dot-urgent { background: #f43f5e; box-shadow: 0 0 8px rgba(244,63,94,0.5); animation: pulseGlow 2s ease-in-out infinite; }

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100% - 60px)); }
}

/* ---- Counter animation ---- */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ---- Pulse / Glow animations ---- */
@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(244,63,94,0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 16px rgba(244,63,94,0.8); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes subtleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ---- Gradient text animation ---- */
.gradient-text-animated {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Floating animation for icons ---- */
.float-animation {
    animation: subtleFloat 4s ease-in-out infinite;
}

/* ---- Glow border effect ---- */
.glow-border-blue {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15), inset 0 0 15px rgba(59, 130, 246, 0.05);
}
.glow-border-cyan {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15), inset 0 0 15px rgba(6, 182, 212, 0.05);
}
.glow-border-emerald {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15), inset 0 0 15px rgba(16, 185, 129, 0.05);
}
.glow-border-amber {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15), inset 0 0 15px rgba(245, 158, 11, 0.05);
}

/* ---- Auto-scroll for long content (signage mode) ---- */
.auto-scroll {
    overflow: hidden;
    position: relative;
}
.auto-scroll-content {
    animation: autoScrollY var(--scroll-duration, 20s) linear infinite;
    animation-delay: var(--scroll-delay, 2s);
}
.auto-scroll-content:hover {
    animation-play-state: paused;
}

@keyframes autoScrollY {
    0%, 10% { transform: translateY(0); }
    90%, 100% { transform: translateY(var(--scroll-distance, -50%)); }
}

/* ---- Page indicator dots ---- */
.page-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}
.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}
.page-dot.active {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59,130,246,0.5);
    width: 24px;
    border-radius: 4px;
}

/* ---- Fullscreen button ---- */
.btn-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-fullscreen:hover {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}

/* ---- Progress bar glow ---- */
.progress-bar-glow {
    position: relative;
}
.progress-bar-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    right: 0;
    width: 40px;
    height: calc(100% + 4px);
    background: radial-gradient(ellipse at right, rgba(6,182,212,0.4), transparent);
    pointer-events: none;
}

/* ---- Status badge with pulse ---- */
.status-live {
    position: relative;
}
.status-live::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ---- Room card for IFP display ---- */
.room-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}
.room-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}

/* ---- Countdown timer display ---- */
.countdown-display {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}
.countdown-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
}
.countdown-segment .value {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #ffffff;
}
.countdown-segment .label {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}
.countdown-separator {
    font-size: 20px;
    color: #475569;
    font-weight: 300;
    margin-top: -12px;
}

/* ---- Announcement card with priority accent ---- */
.announcement-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    border-left: 4px solid;
}
.announcement-card.priority-normal { border-left-color: #3b82f6; }
.announcement-card.priority-penting { border-left-color: #f59e0b; }
.announcement-card.priority-urgent { 
    border-left-color: #f43f5e;
    background: rgba(244, 63, 94, 0.03);
}

/* ---- Stat card with animated border ---- */
.stat-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, linear-gradient(90deg, #3b82f6, #06b6d4));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.stat-card:hover::before {
    opacity: 1;
}
.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ---- Peserta list item ---- */
.peserta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    transition: background 0.15s ease;
}
.peserta-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.peserta-item .peserta-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
    font-weight: 600;
}
.peserta-item .peserta-name {
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Tata tertib styling ---- */
.tata-tertib-item {
    display: flex;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    padding: 8px 0;
}
.tata-tertib-item .tt-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}
.tata-tertib-item .tt-text {
    color: #94a3b8;
}

/* ---- Welcome banner shimmer effect ---- */
.banner-shimmer {
    position: relative;
    overflow: hidden;
}
.banner-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
    animation: shimmer 6s ease-in-out infinite;
}

/* ---- Admin Styles ---- */
.admin-sidebar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.06);
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.2s ease;
    margin: 2px 0;
}
.admin-sidebar a:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}
.admin-sidebar a.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ---- Form Styles ---- */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: #f8fafc;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    outline: none;
    transition: all 0.2s ease;
}
.form-input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(255,255,255,0.07);
}
.form-input::placeholder {
    color: #475569;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 6px;
}
select.form-input {
    cursor: pointer;
}
select.form-input option {
    background: #1e293b;
    color: #f8fafc;
}

/* ---- Button Styles ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.1);
}
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* ---- Table Styles ---- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.data-table thead th:first-child { border-radius: 10px 0 0 0; }
.data-table thead th:last-child { border-radius: 0 10px 0 0; }
.data-table tbody td {
    padding: 10px 16px;
    font-size: 13px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table tbody tr:hover td {
    background: rgba(255,255,255,0.03);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Toast / Alert ---- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease-out;
    max-width: 400px;
}
.toast-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.toast-error {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pagination button, .pagination a {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.pagination button:hover, .pagination a:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.08);
}
.pagination .active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}
.pagination .disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ---- Display page container: must fill remaining content area for scroll to work ---- */
.display-page {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Inner content of each display page must also fill via flex */
.display-page > div {
    flex: 1;
    min-height: 0;
}

/* ---- IFP Signage specific - larger text scaling ---- */
@media (min-width: 1920px) {
    .display-page {
        font-size: 16px;
    }
}
@media (min-width: 3840px) {
    .display-page {
        font-size: 20px;
    }
    .nav-btn {
        padding: 14px 28px;
        font-size: 18px;
        gap: 12px;
    }
}
