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

:root {
    --primary: #0066cc;
    --primary-light: #0052a3;
    --secondary: #5e6cd2;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #06b6d4;
    --dark: #1a202c;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* ============ NAV ============ */
.navbar {
    background: white;
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
}

.navbar-text {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.dropdown-menu {
    border-radius: 12px;
    min-width: 220px;
}

.dropdown-item:active {
    background-color: var(--primary);
}

/* ============ MAIN CONTAINER ============ */
.content-wrapper {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============ CARDS ============ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ============ BUTTONS ============ */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #ecf0f1;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #d5dbdb;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* ============ FORMS ============ */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control,
.form-select {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

textarea.form-control {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

.form-check-input {
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-top: 0.3rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.input-group .form-control,
.input-group .form-select {
    border-radius: 8px 0 0 8px;
}

.input-group .btn-outline-secondary {
    border-radius: 0 8px 8px 0;
    border: 2px solid var(--border);
}

/* ============ FORMSET ============ */
.formset-table {
    width: 100%;
    margin-bottom: 1rem;
}

.formset-table input,
.formset-table select {
    font-size: 0.9rem;
}

/* ============ FORM LAYOUT ============ */
.form-group {
    margin-bottom: 1rem;
}

.form-section {
    border-bottom: 2px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* ============ TABLES ============ */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.table thead th {
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--light);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 102, 204, 0.02);
}

/* ============ ALERTS ============ */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    border-left: 4px solid;
}

.alert-primary {
    background: #dbeafe;
    border-left-color: var(--primary);
    color: #0c3c7d;
}

.alert-success {
    background: #dcfce7;
    border-left-color: var(--success);
    color: #166534;
}

.alert-warning {
    background: #fef3c7;
    border-left-color: var(--warning);
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    border-left-color: var(--danger);
    color: #991b1b;
}

/* ============ LOGIN PAGE ============ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
}

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

.login-header h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
}

/* ============ DASHBOARD ============ */
.dashboard-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-card p {
    opacity: 0.9;
}

/* ============ RESPONSIVE ============ */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table tbody td {
        padding: 0.75rem 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

/* ============ UTILITIES ============ */
.text-muted {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.bg-light {
    background: var(--light);
}

.border-top {
    border-top: 1px solid var(--border);
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============ SEARCH FORM ============ */
.search-form {
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.search-form .input-group-text {
    padding-left: 1.25rem;
}

.search-form .form-control {
    border: none;
    box-shadow: none !important;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

/* ============ QUESTION CARD ============ */
.question-card {
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.question-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.01);
}

.question-card .card-header {
    background: white;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
}

.bg-success-subtle { background-color: rgba(5, 150, 105, 0.1); }
.bg-warning-subtle { background-color: rgba(217, 119, 6, 0.1); }
.text-success { color: #059669 !important; }
.text-warning { color: #d97706 !important; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ============ SEARCH CONTAINER ENHANCEMENTS ============ */
.search-container {
    background: white;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-container:focus-within {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.search-container .input-group-text {
    font-size: 1.1rem;
    color: var(--primary);
}

.search-container .form-control {
    font-size: 1.1rem;
    font-weight: 500;
}

.search-container button:hover {
    color: var(--danger) !important;
    background: transparent !important;
}

.cursor-pointer {
    cursor: pointer;
}
