@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    /* Colors - Blocksy Dark Theme */
    --bg-dark: #071a10;
    --bg-card: #0b2618;
    --bg-hover: #143825;
    --border-color: #ccff00;
    
    --accent-primary: #ccff00; /* Lime Green */
    --accent-hover: #b4f843;
    
    --text-main: #ffffff;
    --text-muted: #888888;
    
    --color-btc: #f59e0b;
    --color-eth: #3b82f6;
    --color-alg: #ff9f43;
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Google Sans', 'Product Sans', sans-serif;
}

input, button, select, textarea, optgroup {
    font-family: inherit;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
}

/* Typography */
h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; font-weight: 600; color: var(--text-main); margin-bottom: 1rem; }
p { color: var(--text-muted); }

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* Mini Sidebar */
.sidebar {
    width: 80px;
    background: var(--bg-dark);
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1.5px solid #ccff00;
}

.sidebar .brand {
    display: none; /* Hide text brand in mini sidebar */
}

.nav-section { display: none; }

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 12px;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(204, 255, 0, 0.1);
    color: var(--accent-primary);
}

.nav-item span { display: none; } /* Hide text */
.nav-item i { width: 20px; height: 20px; }

.promo-card { display: none; } /* Hide promo card in mini sidebar */

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    overflow-y: auto;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    background: var(--bg-dark);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.brand-full {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    white-space: nowrap;
}

/* Horizontal Nav */
.top-nav {
    display: flex;
    background: var(--bg-card);
    border: 1.5px solid #ccff00;
    border-radius: 8px; /* minimal and elegant rectangular shape */
    align-items: center;
}

.top-nav-item {
    padding: 10px 20px;
    border-right: 1.5px solid #ccff00;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.top-nav-item:last-child {
    border-right: none;
}

.top-nav-item:hover { color: var(--text-main); }
.top-nav-item.active {
    background: rgba(255,255,255,0.05);
    color: var(--accent-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    position: relative;
    width: 240px;
}
.search-bar i, .search-bar svg {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-muted);
    width: 18px; height: 18px;
    pointer-events: none;
}
.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-card);
    border: 1.5px solid #ccff00;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: var(--transition);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid #ccff00;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.icon-btn:hover { color: var(--text-main); }

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.user-info { display: none; } /* Hide user info in topbar */

/* Views Container */
.main-content { padding: 0 40px 40px; }
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1.5px solid #ccff00;
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.icon-btc { background: transparent; border: 1.5px solid var(--color-btc); color: var(--color-btc); }
.icon-eth { background: transparent; border: 1.5px solid var(--color-eth); color: var(--color-eth); }
.icon-alg { background: transparent; border: 1.5px solid var(--color-alg); color: var(--color-alg); }

.stat-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.stat-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Dashboard Middle Section */
.dashboard-middle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Action Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-hover);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.btn:hover { background: #333333; }

.btn-primary {
    background: var(--accent-primary);
    color: #000000;
}
.btn-primary:hover {
    background: var(--accent-hover);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1.5px solid #ccff00;
    border-radius: var(--radius-lg);
    margin-top: 24px;
}
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    padding: 16px 24px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1.5px solid #ccff00;
}
td {
    padding: 16px 24px;
    color: var(--text-main);
    border-bottom: 1.5px solid #ccff00;
    font-size: 0.9rem;
    font-weight: 500;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Shared UI Components */
.badge-ekskul {
    background: rgba(204,255,0,0.1); 
    color: #ccff00; 
    padding: 4px 20px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    border: 1.5px solid #ccff00;
    min-width: 80px;
    text-align: center;
    display: inline-block;
    font-weight: 600;
}
.rombel-name {
    color: #ccff00; 
    font-weight: bold; 
    font-size: 1.1rem;
}

/* Modals */
.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.present { background: rgba(204, 255, 0, 0.1); color: var(--accent-primary); }
.badge.absent { background: rgba(236, 72, 153, 0.1); color: var(--color-alg); }
.badge.neutral { background: var(--bg-hover); color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-muted); font-size: 0.85rem;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #ccff00;
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Business Card (Search Results) */
.business-card {
    background: var(--bg-card);
    border: 1.5px solid #ccff00;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
    max-width: 450px;
}
.card-name { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.card-rombel { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; display: inline-block;}
.sprite-img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; border-radius: 4px; }
.showcase-card {
    background: var(--bg-dark);
    border: 1.5px solid #ccff00;
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(20% - 13px);
    min-width: 120px;
}

/* Login Page specific */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-dark);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(5px);
}

.modal-overlay .card {
    max-height: 90vh;
    overflow-y: auto;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1.5px solid #ccff00;
}
.login-tabs {
    display: flex;
    margin-bottom: 24px;
    background: var(--bg-dark);
    border-radius: 999px;
    padding: 4px;
}
.login-tab {
    flex: 1; text-align: center; padding: 10px; cursor: pointer; border-radius: 999px; font-weight: 500; color: var(--text-muted); font-size: 0.9rem;
}
.login-tab.active { background: var(--bg-hover); color: var(--accent-primary); }

/* Responsive */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-middle { grid-template-columns: 1fr; }
    .showcase-card { width: calc(33.33% - 11px); }
    
    .topbar-left { flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; }
    .top-nav { width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .desktop-dashboard { display: none !important; }
    .mobile-launcher { display: grid !important; }
    #dashboard.view { padding: 0 !important; background: #121212 !important; min-height: calc(100vh - 70px); align-items: start; }
    .sidebar { display: none; }
    .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--glass-bg); border: 1.5px solid #ccff00; color: var(--text-light); }
    .stat-grid { grid-template-columns: 1fr; }
    .topbar { padding: 16px 20px; flex-direction: column; gap: 16px; align-items: flex-start; background: transparent !important; border-bottom: none !important; }
    
    .top-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        white-space: normal;
        overflow: hidden;
        padding: 0;
    }
    .top-nav-item {
        border-bottom: 1.5px solid #ccff00;
        border-right: 1.5px solid #ccff00;
        padding: 8px 4px;
        font-size: 0.75rem;
        text-align: center;
    }
    .top-nav-item:nth-child(3n) {
        border-right: none;
    }
    .top-nav-item:nth-last-child(-n+3) {
        border-bottom: none;
    }

    .topbar-right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px !important;
    }
    .search-bar {
        width: 100%;
        order: 99;
        margin-top: 4px;
    }
    #topbarClockContainer {
        border-left: none !important;
        padding-left: 0 !important;
    }

    .main-content { padding: 24px 20px; }
    .showcase-card { width: calc(50% - 8px); }
    
    .calendar-layout { flex-direction: column; gap: 16px; }
    .calendar-right { border-left: none !important; border-top: 1.5px dashed #ccff00; padding-left: 0 !important; padding-top: 24px; max-height: 300px !important; }
    .modal-overlay .card { max-height: 80vh; max-width: 90%; }
    
    /* Mobile Tables to Cards */
    .table-container thead { display: none; }
    .table-container table, .table-container tbody, .table-container tr, .table-container td { display: block; width: 100%; }
    .table-container tr { margin-bottom: 16px; border-radius: 8px; border: 1.5px solid #ccff00; padding: 12px; background: var(--bg-hover); }
    .table-container td { text-align: right; padding-left: 50%; position: relative; border-bottom: none; }
    .table-container td::before { content: attr(data-label); position: absolute; left: 12px; width: 45%; padding-right: 10px; white-space: nowrap; text-align: left; font-weight: bold; color: var(--text-muted); }

    /* Custom Rombel Table Mobile Layout (Matches Business Card) */
    #rombelTableBody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "name name"
            "sport art";
        background: #121212;
        border: 2px solid #ccff00;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: 0 0 15px rgba(204, 255, 0, 0.2);
        gap: 12px;
    }
    #rombelTableBody td {
        padding: 0 !important;
        text-align: center !important;
        border: none !important;
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #rombelTableBody td::before { display: none !important; }
    
    #rombelTableBody td:nth-child(1) {
        grid-area: name;
        font-size: 1.2rem !important;
        color: #ccff00 !important;
        text-shadow: 0 0 5px rgba(204,255,0,0.4);
        text-transform: uppercase;
        margin-bottom: 4px;
        width: 100% !important;
    }
    #rombelTableBody td:nth-child(2) { grid-area: sport; }
    #rombelTableBody td:nth-child(3) { grid-area: art; }
    
    .attendance-btn-group { display: flex !important; flex-direction: row !important; width: 100%; gap: 12px !important; justify-content: center !important; }
    .attendance-btn-group button { flex: 0 0 80px !important; width: 80px !important; padding: 8px 0 !important; font-size: 0.85rem; text-align: center; border-radius: 20px; }
    .table-container input, .table-container select { width: 100% !important; box-sizing: border-box; }
    .table-container button:not(.att-btn) { width: 100% !important; padding: 10px !important; margin-top: 8px; }
}
.calendar-layout { display: flex; gap: 32px; flex-wrap: wrap; }
.calendar-left { flex: 1; min-width: 280px; }
.calendar-right { flex: 1; min-width: 280px; border-left: 1.5px dashed #ccff00; padding-left: 32px; max-height: 500px; overflow-y: auto; }
.hidden { display: none !important; }
.mobile-menu-btn { display: none !important; }

/* Mobile Launcher Styles */
.mobile-launcher {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 24px;
    margin-top: 20px;
    width: 100%;
}
.launcher-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.app-icon {
    width: 60px;
    height: 60px;
    background: #1a1a24;
    border-radius: 18px; /* Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccff00; /* Lime Green */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-bottom: 8px;
    border: 1.5px solid #ccff00;
    transition: transform 0.2s;
}
.app-icon i, .app-icon svg {
    width: 28px;
    height: 28px;
}
.launcher-app:active .app-icon {
    transform: scale(0.9);
}
.app-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
}


/* Icon styles */
.lucide { stroke-width: 1.5px !important; fill: none !important; }

/* Elegant Calendar Styles */
#calendarModal .card {
    background: rgba(16, 16, 24, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(204, 255, 0, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05) !important;
    border-radius: 20px !important;
}

#calendarGrid {
    gap: 8px !important;
}

#calendarGrid .cal-cell {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#calendarGrid .cal-cell:hover {
    background: rgba(204, 255, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 255, 0, 0.15);
    border-color: rgba(204, 255, 0, 0.3);
}

#calendarGrid .cal-cell.today {
    background: rgba(204, 255, 0, 0.15) !important;
    border: 1.5px solid #ccff00 !important;
    box-shadow: 0 0 15px rgba(204, 255, 0, 0.2) !important;
}

#calendarGrid .cal-cell.has-agenda {
    position: relative;
    border-color: rgba(255, 71, 87, 0.5) !important;
}
#calendarGrid .cal-cell.has-agenda::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ff4757;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff4757;
}

.calendar-right {
    border-left: 1px solid rgba(255,255,255,0.1) !important;
}

#agendaList .agenda-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}
#agendaList .agenda-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(204, 255, 0, 0.2);
}

.memo-card {
    background: linear-gradient(135deg, #f9f9db 0%, #fff6a1 100%);
    border-radius: 4px 4px 16px 4px;
    padding: 20px;
    color: #333;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    min-height: 120px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}
.memo-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c0392b);
    border-radius: 50%;
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.3);
}
.memo-card h4 {
    margin-top: 5px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 4px;
}
.memo-card .memo-ekskul {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 12px;
}
.memo-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #2c3e50;
}
.memo-delete {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #c0392b;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.memo-delete:hover {
    opacity: 1;
}

