/* ===== VARIABLES & RESET ===== */
:root {
    --primary: #1e3a8a;
    --primary-dark: #3a56d4;
    --secondary: #3b82f6;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== CONTAINER & CARD ===== */
.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.logo {
    font-size: 36px;
    margin-bottom: 15px;
}

/* ===== FORM STYLES ===== */
.form-container {
    padding: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* ===== SURVEY QUESTION STYLES ===== */
.question-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.question-card:hover {
    transform: translateX(5px);
    background: #ffffff;
}

.question-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: 600;
    margin-right: 10px;
}

.question-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ===== RADIO BUTTON STYLES ===== */
.rating-scale {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.rating-option {
    flex: 1;
    min-width: 80px;
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-option label {
    display: block;
    text-align: center;
    padding: 12px 5px;
    background: white;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--gray);
}

.rating-option input[type="radio"]:checked + label {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

.rating-option label:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--gray);
    font-size: 14px;
    padding: 0 10px;
}

/* ===== BUTTON CONTAINER ===== */
.btn-container {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-block;
    padding: 16px 25px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    flex: 1;
    min-width: 140px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.btn-secondary:hover {
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

/* ===== SUCCESS PAGE ===== */
.success-container {
    text-align: center;
    padding: 60px 40px;
}

.success-icon {
    font-size: 80px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.success-container h2 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 32px;
}

.success-container p {
    color: var(--gray);
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    margin: 20px 40px 30px;
}

.progress-bar {
    height: 10px;
    background: var(--light-gray);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
}

/* ===== Additional styles for delete features ===== */
.delete-section {
    background: #fff3cd;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 4px solid #ffc107;
}

.delete-warning {
    background: #f8d7da;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
}

/* =========================================
BARIS BARU: UPDATE FLASH MESSAGE & VALIDASI
   ========================================= */

/* ===== FLASH MESSAGES ===== */
.flash-messages {
    padding: 0 40px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ERROR MESSAGES ===== */
.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.hint {
    color: #6c757d;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* ===== FORM VALIDATION STATES ===== */
input.error, select.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

input.success, select.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* ===== FORM INFO ===== */
.form-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #6c757d;
    border-left: 4px solid #007bff;
}

.form-info i {
    color: #007bff;
    margin-right: 8px;
}

/* ===== BUTTON LOADING STATE ===== */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
AKHIR DARI UPDATE
   ========================================= */

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 14px;
    border-top: 1px solid var(--light-gray);
    background: #f8f9fa;
}

/* ===== CATEGORY INFO ===== */
.category-info {
    background: linear-gradient(135deg, #4361ee 0%, #4cc9f0 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
}

.category-info h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.category-info p {
    opacity: 0.9;
    margin: 0;
}

/* ===== CHART CONTAINER STYLES ===== */
.chart-container {
    position: relative;
    margin: 20px 0;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ===== SEARCH & FILTER STYLES ===== */
.search-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .search-controls {
        grid-template-columns: 1fr;
    }
}

.search-input {
    padding: 12px 15px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.results-table th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--light-gray);
}

.results-table tr:hover {
    background: #f8f9fa;
}

.results-info {
    margin-top: 10px;
    font-size: 14px;
    color: var(--gray);
    text-align: center;
}

/* ===== GAUGE CHART STYLES ===== */
.gauge-container {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 0 auto;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gauge-label {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 14px;
    color: var(--gray);
}

/* ===== LOADING ANIMATION ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(67, 97, 238, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE CHART GRID ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== BADGE STYLES ===== */
.score-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-low {
    background: #FFEBEE;
    color: #C62828;
}

.badge-medium {
    background: #FFF8E1;
    color: #FF8F00;
}

.badge-high {
    background: #E8F5E9;
    color: #2E7D32;
}

/* NOTIFICATIONS */
.notification {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

.notification.success {
    border-color: #4CAF50;
}

.notification.error {
    border-color: #dc3545;
}

.notification.info {
    border-color: #2196F3;
}

.notification.warning {
    border-color: #FF9800;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* LOADING STATES */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-state .fa-spin {
    font-size: 24px;
    margin-bottom: 10px;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.error-state i {
    font-size: 24px;
    margin-bottom: 10px;
}

/* RESULTS TABLE */
.results-scroll {
    max-height: 250px;
    overflow-y: auto;
}

.results-scroll table {
    width: 100%;
    border-collapse: collapse;
}

.results-scroll th {
    background: #f8f9fa;
    padding: 10px 15px;
    text-align: left;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
}

.results-scroll td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.results-scroll tr:hover {
    background: #f8f9fa;
}

.score-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.score-badge.high {
    background: #e8f5e9;
    color: #2e7d32;
}

.score-badge.medium {
    background: #fff3e0;
    color: #ef6c00;
}

.score-badge.low {
    background: #ffebee;
    color: #c62828;
}

/* PERFORMER INFO */
.performer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank {
    width: 24px;
    height: 24px;
    background: #4361ee;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.area-name {
    flex: 1;
}

.area-score {
    font-weight: 600;
    color: #4361ee;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4361ee, #7209b7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: #4361ee;
    margin-bottom: 15px;
}

.login-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #888;
}

.login-footer i {
    margin-right: 5px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .form-container {
        padding: 25px;
    }
    
    .header {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .rating-scale {
        gap: 5px;
    }
    
    .rating-option {
        min-width: 60px;
    }
    
    .rating-option label {
        padding: 10px 5px;
        font-size: 14px;
    }
    
    .question-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        background: white;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .rating-scale {
        flex-direction: column;
        gap: 8px;
    }
    
    .rating-option {
        min-width: 100%;
    }
}