/* style.css - Modern Academic Design System for Voting Ketua Angkatan 2025 Bisnis Digital */

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

:root {
    /* Font Families */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Light Theme (Default) - Putih Ungu */
    --bg-primary: #f5f3ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #faf9fe;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-color: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-soft: #ede9fe;
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --border-color: #e2e8f0;
    --card-shadow: 0 12px 30px -10px rgba(15, 23, 42, 0.08), 0 4px 12px -5px rgba(15, 23, 42, 0.03);
    --hover-shadow: 0 20px 40px -15px rgba(124, 58, 237, 0.15);
    
    /* Glassmorphism settings */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: 12px;

    /* Bootstrap overrides for light mode */
    --bs-body-bg: var(--bg-primary);
    --bs-body-color: var(--text-primary);
    --bs-tertiary-bg: var(--bg-tertiary);
    --bs-secondary-bg: var(--bg-secondary);
    --bs-secondary-color: var(--text-secondary);
    --bs-border-color: var(--border-color);
    --bs-primary: #7c3aed;
    --bs-primary-rgb: 124, 58, 237;
}

[data-theme="dark"], [data-bs-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #0a0712;
    --bg-secondary: #130f22;
    --bg-tertiary: #1c172f;
    --text-primary: #f8fafc;
    --text-secondary: #a7a2bd;
    --text-muted: #6c6687;
    
    --accent-color: #a78bfa;
    --accent-hover: #c4b5fd;
    --accent-soft: rgba(167, 139, 250, 0.15);
    
    --border-color: #241e3d;
    --card-shadow: 0 15px 35px -12px rgba(0, 0, 0, 0.4), 0 5px 15px -8px rgba(0, 0, 0, 0.2);
    --hover-shadow: 0 20px 40px -12px rgba(167, 139, 250, 0.25);
    
    --glass-bg: rgba(19, 15, 34, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);

    /* Bootstrap overrides for dark mode */
    --bs-body-bg: var(--bg-primary);
    --bs-body-color: var(--text-primary);
    --bs-tertiary-bg: var(--bg-tertiary);
    --bs-secondary-bg: var(--bg-secondary);
    --bs-secondary-color: var(--text-secondary);
    --bs-border-color: var(--border-color);
    --bs-primary: #a78bfa;
    --bs-primary-rgb: 167, 139, 250;
}

/* Custom Utility Overrides for Perfect Dark Mode Contrast */
.text-secondary {
    color: var(--text-secondary) !important;
}
.text-muted {
    color: var(--text-muted) !important;
}
.bg-body-tertiary {
    background-color: var(--bg-tertiary) !important;
}
.bg-secondary-custom {
    background-color: var(--bg-tertiary) !important;
}
.bg-primary-soft {
    background-color: var(--accent-soft) !important;
}
.border-light-subtle {
    border-color: var(--border-color) !important;
}

/* Base resets and configuration with smooth global transitions */
body, .glass-panel, .admin-sidebar, .stat-card, .form-control-custom, .table-custom, .table-custom td, .table-custom th, footer, .navbar-custom, .card, .admin-menu-item a, h1, h2, h3, h4, h5, h6, p, span, .btn-secondary-custom {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Glassmorphism Component */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Navbar */
.navbar-custom {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    padding: 12px 0;
    z-index: 1000;
}

.navbar-brand-custom {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.logo-text {
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (min-width: 576px) {
    .logo-text {
        font-size: 1.15rem;
    }
}

/* Custom Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent-color), #6d28d9);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--accent-hover), #5b21b6);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-secondary-custom {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary-custom:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-success-custom {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success-custom:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* Hero Section */
.hero-section {
    padding: 100px 0 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
}

.hero-shape-1 {
    top: -50px;
    right: -50px;
}

.hero-shape-2 {
    bottom: -50px;
    left: -100px;
}

/* Candidate Card Styling */
.candidate-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.candidate-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent-color);
}

.candidate-number {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-color), #6d28d9);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.candidate-img-wrapper {
    width: 140px;
    height: 140px;
    margin: 10px auto 20px auto;
    border-radius: 50%;
    padding: 6px;
    border: 3px solid var(--accent-soft);
    background: var(--bg-secondary);
    transition: all 0.4s ease;
}

.candidate-card:hover .candidate-img-wrapper {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.candidate-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: var(--bg-primary);
}

.candidate-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.candidate-motto {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    min-height: 24px;
}

.candidate-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
    flex-grow: 1;
}

/* Countdown Clock */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.countdown-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    min-width: 80px;
    padding: 12px;
    text-align: center;
}

.countdown-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1.2;
    font-family: var(--font-heading);
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}

/* Admin Sidebar Layout */
.admin-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 99;
}

.admin-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.admin-sidebar-menu {
    padding: 20px 15px;
    list-style: none;
    margin: 0;
    flex-grow: 1;
}

.admin-menu-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.admin-menu-item a:hover, .admin-menu-item.active a {
    color: var(--accent-color);
    background: var(--accent-soft);
}

.admin-menu-item.active a {
    font-weight: 600;
}

.admin-content {
    flex-grow: 1;
    background-color: var(--bg-primary);
    padding: 40px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-soft);
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Form Styles */
.form-control-custom {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-soft);
    color: var(--text-primary);
    outline: none;
}

.form-label-custom {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Footer styling */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 25px 0;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Dark Mode Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
}

.theme-switch-btn:hover {
    background: var(--accent-soft);
    transform: scale(1.05);
}

/* Table Style */
.table-custom {
    width: 100%;
    background-color: var(--bg-secondary);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-custom th {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table-custom td {
    padding: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.table-custom tr:last-child td {
    border-bottom: none;
}

/* Badge status */
.badge-custom {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-info {
    background-color: rgba(124, 58, 237, 0.15);
    color: var(--accent-color);
}

/* Responsive elements */
@media (max-width: 991.98px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .admin-sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }
    .admin-menu-item {
        flex: 1 1 auto;
        margin-bottom: 0;
    }
    .admin-content {
        padding: 20px;
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-color), #6366f1) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    display: inline-block;
}

/* --- Kustomisasi Mobile Navbar & Tombol Toggler --- */

.navbar-toggler {
    width: 40px;
    height: 40px;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
}

.toggler-icon-bar {
    position: absolute;
    left: 10px;
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.top-bar {
    top: 13px;
}

.middle-bar {
    top: 19px;
}

.bottom-bar {
    top: 25px;
}

/* Animasi Hamburger-ke-Silang */
.navbar-toggler:not(.collapsed) .top-bar {
    transform: translateY(6px) rotate(45deg);
}

.navbar-toggler:not(.collapsed) .middle-bar {
    opacity: 0;
    transform: scale(0);
}

.navbar-toggler:not(.collapsed) .bottom-bar {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 991.98px) {
    /* Desain menu dropdown glassmorphism */
    .navbar-collapse {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        margin-top: 12px;
        padding: 20px;
        box-shadow: var(--card-shadow);
        animation: slideDownFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        transform-origin: top center;
    }

    /* Penataan vertikal terpusat */
    .navbar-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .navbar-nav .nav-item {
        width: 100%;
        text-align: center;
        margin: 0 !important;
    }

    .navbar-nav .nav-link {
        display: inline-block;
        width: auto;
        padding: 8px 24px !important;
        border-radius: 30px;
        transition: all 0.3s ease;
        color: var(--text-primary) !important;
    }

    .navbar-nav .nav-link:hover {
        background-color: var(--accent-soft);
        color: var(--accent-color) !important;
        transform: translateY(-1px);
    }

    /* Voter badge di mobile */
    .navbar-nav .badge {
        display: inline-block;
        padding: 10px 20px !important;
        font-size: 0.9rem;
    }

    /* Tombol Keluar (Logout) di mobile */
    .navbar-nav .btn-danger {
        display: inline-block;
        width: 80%;
        max-width: 200px;
        border-radius: 30px;
        padding: 10px 24px !important;
        margin-top: 4px;
    }

    /* Tombol tema di mobile */
    .theme-switch-btn {
        width: 44px;
        height: 44px;
        margin: 0 auto;
        background-color: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    @keyframes slideDownFade {
        from {
            opacity: 0;
            transform: translateY(-10px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* Responsivitas Countdown Timer untuk Layar Kecil */
@media (max-width: 480px) {
    .countdown-container {
        gap: 8px !important;
    }
    .countdown-box {
        min-width: 70px !important;
        padding: 8px !important;
    }
    .countdown-number {
        font-size: 1.5rem !important;
    }
    .countdown-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.5px !important;
    }
}

/* CSS Print Stylesheet */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .navbar, .admin-sidebar, .btn, .no-print {
        display: none !important;
    }
    .admin-content {
        padding: 0 !important;
        width: 100% !important;
    }
    .stat-card {
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
    }
    .table-custom {
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
    }
    .table-custom th {
        background-color: #f0f0f0 !important;
        border-bottom: 1px solid #cccccc !important;
    }
    .table-custom td {
        border-bottom: 1px solid #cccccc !important;
    }
}
