/* Custom CSS for Voter Survey Application */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Language Switcher */
.language-switcher {
    text-align: right;
}

.language-switcher .btn-group .btn {
    border-radius: 0;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.language-switcher .btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.language-switcher .btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.language-switcher .btn-group .btn:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.language-switcher .btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .language-switcher {
    text-align: left;
}

/* Hindi Text Support */
.hindi-text {
    font-family: 'Devanagari Sangam MN', 'Noto Sans Devanagari', 'Mangal', sans-serif;
    line-height: 1.6;
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary-color) !important;
}

.survey-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px 0;
}

.survey-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

.survey-header h1 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.survey-header p {
    color: var(--secondary-color);
    font-size: 1.1em;
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.form-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.satisfaction-rating {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rating-option {
    flex: 1;
    min-width: 120px;
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-option label {
    display: block;
    padding: 12px 8px;
    text-align: center;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
}

.rating-option label:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.rating-option input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.rating-1:checked + label { background: var(--danger-color); border-color: var(--danger-color); }
.rating-2:checked + label { background: #fd7e14; border-color: #fd7e14; }
.rating-3:checked + label { background: var(--warning-color); border-color: var(--warning-color); color: #212529; }
.rating-4:checked + label { background: var(--info-color); border-color: var(--info-color); }
.rating-5:checked + label { background: var(--success-color); border-color: var(--success-color); }

.issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.issue-option {
    position: relative;
}

.issue-option input[type="checkbox"] {
    display: none;
}

.issue-option label {
    display: block;
    padding: 15px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
}

.issue-option label:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.issue-option input[type="checkbox"]:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.issue-option input[type="checkbox"]:checked + label::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 10px;
    font-weight: bold;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.alert {
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.invalid-feedback {
    display: block;
    font-size: 0.875em;
    color: var(--danger-color);
    margin-top: 5px;
}

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

.footer {
    background: var(--dark-color);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

.footer p {
    margin: 0;
    color: #adb5bd;
}

.loading {
    display: none;
}

.loading.show {
    display: inline-block;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Admin Dashboard Styles */
.dashboard-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

.stat-card {
    text-align: center;
    padding: 25px;
}

.stat-card .stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-card .stat-label {
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table th {
    background: var(--light-color);
    color: var(--dark-color);
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    vertical-align: middle;
}

.badge {
    font-size: 0.75em;
    padding: 5px 10px;
    border-radius: 12px;
}

.satisfaction-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.8em;
    font-weight: 600;
}

.satisfaction-1 { background: var(--danger-color); }
.satisfaction-2 { background: #fd7e14; }
.satisfaction-3 { background: var(--warning-color); color: #212529; }
.satisfaction-4 { background: var(--info-color); }
.satisfaction-5 { background: var(--success-color); }

/* Responsive Design */
@media (max-width: 768px) {
    .survey-container {
        margin: 10px;
        padding: 20px;
    }
    
    .satisfaction-rating {
        flex-direction: column;
    }
    
    .rating-option {
        min-width: 100%;
    }
    
    .issues-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card .stat-number {
        font-size: 2em;
    }
    
    .table-responsive {
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .survey-header h1 {
        font-size: 1.8em;
    }
    
    .survey-header p {
        font-size: 1em;
    }
    
    .form-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .btn-primary {
        padding: 10px 20px;
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .survey-container,
    .dashboard-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #e9ecef;
    z-index: 9999;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .survey-container,
    .dashboard-card {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .form-control {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .form-section {
        background: #2a2a2a;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus styles for accessibility */
.form-control:focus,
.rating-option label:focus,
.issue-option label:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .rating-option label,
    .issue-option label {
        border-width: 3px;
    }
}