/**
 * =============================================================================
 * FILE CSS - style.css
 * =============================================================================
 * File ini berisi semua styling untuk aplikasi pemilihan OSIS
 * Menggunakan CSS modern dengan flexbox dan grid
 */

/* ============================================================================
   CSS RESET & BASE STYLES
   ============================================================================
   Reset default browser styles dan set base styles
*/

/* Reset semua elemen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base font dan smooth scrolling */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* Body styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}

/* ============================================================================
   LAYOUT UTAMA
   ============================================================================ */

/* Container utama - membatasi lebar konten */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================================
   HEADER / NAVBAR
   ============================================================================
   Styling untuk bagian atas halaman
*/

.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Logo dan brand */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    padding: 10px;
    border-radius: 10px;
    color: white;
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.brand-text p {
    font-size: 0.875rem;
    color: #64748b;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================================
   BADGE / LABEL
   ============================================================================
   Komponen untuk menampilkan status/label
*/

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #22c55e;
    color: white;
}

.badge-outline {
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.badge-purple {
    background: #e9d5ff;
    color: #7c3aed;
}

/* ============================================================================
   BUTTONS
   ============================================================================
   Styling untuk tombol-tombol
*/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* Tombol utama (biru) */
.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Tombol outline */
.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f1f5f9;
}

/* Tombol merah (danger) */
.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Tombol dengan warna khusus */
.btn-blue {
    background: #3b82f6;
    color: white;
}

.btn-green {
    background: #22c55e;
    color: white;
}

.btn-orange {
    background: #f97316;
    color: white;
}

/* Tombol full width */
.btn-block {
    width: 100%;
}

/* Tombol disabled */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   CARDS
   ============================================================================
   Komponen card untuk menampilkan konten
*/

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================================================
   FORM / INPUT
   ============================================================================
   Styling untuk form dan input fields
*/

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.login-header p {
    color: #64748b;
    font-size: 0.875rem;
}

.demo-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.875rem;
}

.demo-info h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.demo-info p {
    color: #64748b;
    margin-bottom: 0.25rem;
}

/* ============================================================================
   HERO SECTION
   ============================================================================
   Bagian banner utama di halaman voting
*/

.hero {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 50%, #7c3aed 100%);
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

/* Pattern background */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */

.progress-section {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-header span {
    font-size: 0.875rem;
}

.progress-header .font-medium {
    font-weight: 500;
    color: #374151;
}

.progress-header .text-muted {
    color: #64748b;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #22c55e 100%);
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* ============================================================================
   KANDIDAT GRID
   ============================================================================ */

.section {
    padding: 3rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #64748b;
}

/* Grid layout untuk kartu kandidat */
.kandidat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* ============================================================================
   KANDIDAT CARD
   ============================================================================ */

.kandidat-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kandidat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Header kartu dengan nomor urut */
.kandidat-header {
    text-align: center;
    padding: 0.75rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Warna header sesuai nomor */
.kandidat-header.blue { background: #3b82f6; }
.kandidat-header.green { background: #22c55e; }
.kandidat-header.orange { background: #f97316; }

/* Foto kandidat */
.kandidat-foto {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

/* Body kartu */
.kandidat-body {
    padding: 1.5rem;
}

/* Info ketua/wakil */
.kandidat-info {
    margin-bottom: 1rem;
}

.kandidat-info .label {
    display: inline-block;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.kandidat-info h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.kandidat-info p {
    font-size: 0.875rem;
    color: #64748b;
}

/* Visi dan Misi */
.kandidat-visi, .kandidat-misi {
    margin-bottom: 1rem;
}

.kandidat-visi h5, .kandidat-misi h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.kandidat-visi p {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kandidat-misi ul {
    list-style: none;
    font-size: 0.875rem;
    color: #64748b;
}

.kandidat-misi li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0.25rem;
}

.kandidat-misi li::before {
    content: '•';
    color: #3b82f6;
    font-weight: bold;
}

/* ============================================================================
   ADMIN DASHBOARD
   ============================================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-title {
    font-size: 0.875rem;
    color: #64748b;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.yellow { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

/* Tabs */
.tabs {
    margin-bottom: 2rem;
}

.tab-list {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    background: white;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    background: #f1f5f9;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Chart container */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: 400px;
    position: relative;
}

/* Tabel */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th,
.table-container td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table-container th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.table-container td {
    font-size: 0.875rem;
    color: #64748b;
}

.table-container tr:hover {
    background: #f8fafc;
}

.table-container td:first-child {
    font-weight: 600;
}

/* ============================================================================
   MODAL / DIALOG
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-header p {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    flex: 1;
}

/* ============================================================================
   ALERT / NOTIFIKASI
   ============================================================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand h4 {
    color: white;
    font-weight: 600;
}

.footer-brand p {
    font-size: 0.875rem;
}

.footer-info {
    text-align: right;
}

.footer-info p {
    font-size: 0.875rem;
}

.footer-info .username {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #1e293b;
    font-size: 0.875rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================
   Menyesuaikan tampilan untuk layar kecil (mobile)
*/

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .kandidat-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-list {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none; }
