/* ==========================================================================
   SISTEM PENJADWALAN RUANGAN PKMK - MODERN 3D & NEOMORPHIC DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;

    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --primary-glow: rgba(79, 70, 229, 0.35);

    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Backgrounds & Glass */
    --bg-page: #f8fafc;
    --surface-card: rgba(255, 255, 255, 0.92);
    --surface-glass: rgba(255, 255, 255, 0.78);
    --surface-glass-dark: rgba(15, 23, 42, 0.82);
    --border-glass: rgba(226, 232, 240, 0.8);
    --border-glow: rgba(99, 102, 241, 0.25);

    /* Text Colors */
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #f1f5f9;

    /* 3D Shadows */
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
    --shadow-3d: 0 25px 50px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    --shadow-glow: 0 0 30px -5px var(--primary-glow);

    /* Transitions */
    --transition-bounce: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.2s ease-in-out;
}

/* Base Setup */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(6, 182, 212, 0.06) 0px, transparent 50%),
        radial-gradient(at 80% 90%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: var(--font-heading);
    color: var(--text-heading);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   3D & GLASS UTILITIES
   ========================================================================== */
.perspective-1000 {
    perspective: 1000px;
}

.tilt-element {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.glass-card {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.glass-card-dark {
    background: var(--surface-glass-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border-radius: 1.25rem;
}

/* Shimmer gradient overlay */
.shimmer-layer {
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    animation: shimmerSlide 8s infinite ease-in-out;
}

@keyframes shimmerSlide {
    0%, 75% { left: -100%; }
    100% { left: 200%; }
}

/* ==========================================================================
   NAVBAR (Frosted Glass & 3D Brand)
   ========================================================================== */
.navbar-frosted {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.brand-icon-3d {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 8px 16px -2px rgba(79, 70, 229, 0.45);
    position: relative;
    transform: perspective(600px) rotateY(-8deg) rotateX(8deg);
    transition: var(--transition-bounce);
}

.navbar-brand:hover .brand-icon-3d {
    transform: perspective(600px) rotateY(0deg) rotateX(0deg) scale(1.08);
    box-shadow: 0 12px 24px -2px rgba(79, 70, 229, 0.6);
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.brand-badge {
    font-size: 0.65rem;
    background: rgba(79, 70, 229, 0.25);
    color: #818cf8;
    border: 1px solid rgba(129, 140, 248, 0.3);
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}

/* ==========================================================================
   BENTO STATS CARDS (Top Overview Dashboard)
   ========================================================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bento-card {
    background: var(--surface-card);
    border: 1px solid var(--border-glass);
    border-radius: 1.15rem;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-bounce);
    cursor: default;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--card-accent, #4f46e5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}

.bento-card:hover::before {
    opacity: 1;
}

.bento-info .bento-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.bento-info .bento-value {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-heading);
}

.bento-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    background: var(--icon-bg, rgba(79, 70, 229, 0.1));
    color: var(--icon-color, #4f46e5);
    box-shadow: 0 4px 12px -2px var(--icon-shadow, rgba(79, 70, 229, 0.2));
    transition: var(--transition-bounce);
}

.bento-card:hover .bento-icon-box {
    transform: scale(1.12) rotate(6deg);
}

/* ==========================================================================
   BUTTONS & 3D CONTROLS
   ========================================================================== */
.btn-modern-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white !important;
    border: none;
    font-weight: 600;
    border-radius: 0.65rem;
    padding: 0.45rem 1.1rem;
    box-shadow: 0 4px 14px -1px rgba(79, 70, 229, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -2px rgba(79, 70, 229, 0.55);
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

.btn-modern-primary:active {
    transform: translateY(0);
}

.btn-modern-outline {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    border-radius: 0.65rem;
    padding: 0.45rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
}

.btn-modern-outline:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.btn-modern-logout {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
    border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    border-radius: 0.65rem !important;
    padding: 0.45rem 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2) !important;
    transition: var(--transition-bounce) !important;
}

.btn-modern-logout:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.55) !important;
    transform: translateY(-2px) !important;
}

/* ==========================================================================
   ROOM LEGEND & FILTER BAR
   ========================================================================== */
.filter-bar-card {
    background: var(--surface-card);
    border: 1px solid var(--border-glass);
    border-radius: 1.15rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.filter-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.room-filter-chip {
    font-size: 0.82rem;
    font-weight: 600;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: var(--transition-bounce);
    cursor: pointer;
    user-select: none;
}

.room-filter-chip:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 6px 14px -3px rgba(15, 23, 42, 0.08);
}

.room-filter-chip.active-chip {
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    box-shadow: 0 6px 16px -2px rgba(15, 23, 42, 0.35) !important;
}

.room-filter-chip.active-chip .room-capacity-chip {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.room-capacity-chip {
    font-size: 0.72rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
}

.room-dot-glow {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

/* ==========================================================================
   FULLCALENDAR v6 CUSTOM MODERN THEME
   ========================================================================== */
.calendar-card {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

#calendar {
    min-height: 720px;
}

.fc {
    font-family: var(--font-main);
}

/* Toolbar Styling */
.fc-toolbar {
    margin-bottom: 1.25rem !important;
    gap: 0.75rem;
    align-items: center;
}

.fc-toolbar-title {
    font-family: var(--font-heading) !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px;
    color: var(--text-heading) !important;
}

.fc-button-group {
    box-shadow: var(--shadow-sm);
    border-radius: 0.65rem;
    overflow: hidden;
}

.fc-button-primary {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: var(--text-heading) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 0.45rem 0.9rem !important;
    text-transform: capitalize !important;
    transition: var(--transition-smooth) !important;
}

.fc-button-primary:hover {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.fc-button-primary.fc-button-active {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.4) !important;
}

.fc-today-button {
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    border-radius: 0.65rem !important;
}

.fc-today-button:disabled {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    opacity: 0.6;
}

/* Grid Headers */
.fc-theme-standard th {
    border-color: #edf2f7 !important;
    background-color: #f8fafc;
    padding: 10px 0 !important;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fc-theme-standard td {
    border-color: #edf2f7 !important;
}

.fc-timegrid-slot {
    height: 38px !important;
}

.fc-timegrid-slot-label {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    padding-right: 8px !important;
}

/* Today highlight */
.fc-day-today {
    background-color: rgba(224, 231, 255, 0.25) !important;
}

/* Now Indicator with Glowing 3D Pulse */
.fc-timegrid-now-indicator-line {
    border-color: #ef4444 !important;
    border-width: 2px !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.fc-timegrid-now-indicator-arrow {
    border-color: #ef4444 transparent transparent !important;
}

/* Events Styling (3D Pills with depth) */
.fc-event {
    border: none !important;
    border-radius: 8px !important;
    padding: 4px 6px !important;
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 8px -1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.25) inset !important;
    cursor: pointer !important;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease !important;
    overflow: hidden !important;
}

.fc-event:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.4) inset !important;
    z-index: 20 !important;
}

.fc-event-main {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fc-event-time {
    font-size: 0.75rem !important;
    opacity: 0.9;
    font-weight: 700 !important;
}

/* ==========================================================================
   MODAL DIALOGS (Glassmorphism & 3D Zoom In)
   ========================================================================== */
.modal.fade .modal-dialog {
    transform: scale(0.92) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.35rem;
    box-shadow: var(--shadow-3d);
    overflow: hidden;
}

.modal-header-gradient {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    color: white;
    padding: 1.25rem 3.25rem 1.25rem 1.5rem;
    border-bottom: none;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

/* Tombol close (X) selalu di pojok kanan atas header modal */
.modal-header-gradient .btn-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    margin: 0;
    z-index: 2;
}

.modal-title-custom {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.2px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: var(--transition-smooth);
    background-color: #ffffff;
}

.form-control:focus, .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* Color swatch preview */
.color-preset-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-preset-btn:hover {
    transform: scale(1.2);
}

/* ==========================================================================
   LOGIN PAGE (Ultra 3D Glass & Ambient WebGL)
   ========================================================================== */
.login-body {
    background: #090d16 !important;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

#bg-canvas-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card-3d {
    width: 100%;
    max-width: 440px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.2);
    border-radius: 1.5rem;
    overflow: hidden;
    transform-style: preserve-3d;
}

.login-header-glow {
    text-align: center;
    padding: 2.25rem 2rem 1.5rem 2rem;
    position: relative;
}

.brand-badge-3d {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.6), 0 0 25px rgba(6, 182, 212, 0.4);
    margin-bottom: 1rem;
    animation: floatBadge 4s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

.login-input-group {
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.login-input-group:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
    background: rgba(30, 41, 59, 0.85);
}

.login-input-group .input-group-text {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding-left: 1rem;
}

.login-input-group .form-control {
    background: transparent;
    border: none;
    color: #f8fafc;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.login-input-group .form-control::placeholder {
    color: #64748b;
}

.login-input-group .form-control:focus {
    box-shadow: none;
    background: transparent;
    color: #ffffff;
}

.login-btn-3d {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem;
    border-radius: 0.85rem;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5), 0 0 15px rgba(6, 182, 212, 0.3);
    transition: var(--transition-bounce);
    width: 100%;
}

.login-btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.7), 0 0 25px rgba(6, 182, 212, 0.5);
    color: #ffffff;
}

.quick-fill-chip {
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    color: #94a3b8;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.quick-fill-chip:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
    color: #e0e7ff;
}

/* ==========================================================================
   ANIMATIONS & RESPONSIVE
   ========================================================================== */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 991px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    #calendar {
        min-height: 540px;
    }
    .fc-toolbar {
        flex-direction: column;
    }
}
