/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

: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;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header h1 {
    color: var(--primary-color);
    font-size: 28px;
}

.site-header nav {
    display: flex;
    gap: 10px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h2 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--secondary-color);
    font-size: 18px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

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

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

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

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

.btn-success:hover {
    background-color: #218838;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #212529;
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 18px;
}

/* Surveys Grid */
.surveys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.survey-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.survey-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.survey-card-header h3 {
    font-size: 20px;
    color: var(--dark-color);
}

.survey-card-body {
    padding: 20px;
}

.survey-card-body p {
    color: var(--secondary-color);
    line-height: 1.6;
}

.survey-card-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 64px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--secondary-color);
    font-size: 16px;
}

/* Footer */
.site-footer {
    background: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
    box-shadow: var(--shadow);
}

.site-footer p {
    color: var(--secondary-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

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

/* Survey Taking Interface */
.survey-container {
    max-width: 800px;
    margin: 0 auto;
}

.survey-header {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.survey-header h1 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.survey-header p {
    color: var(--secondary-color);
}

.progress-bar-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.progress-bar {
    height: 10px;
    background-color: var(--light-color);
    border-radius: 5px;
    overflow: hidden;
}

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

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--secondary-color);
    font-size: 14px;
}

.survey-page {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.page-description {
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.question-block {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.question-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.question-options {
    margin-top: 15px;
}

/* Rating Scale */
.rating-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.rating-option {
    flex: 1;
    text-align: center;
}

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

.rating-option label {
    display: block;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

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

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

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: var(--secondary-color);
}

/* Likert Scale */
.likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0;
}

.likert-option {
    flex: 1;
    text-align: center;
}

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

.likert-option label {
    display: block;
    padding: 15px 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

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

.likert-option label:hover {
    border-color: var(--primary-color);
}

/* Matrix Question */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.matrix-table th,
.matrix-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.matrix-table th {
    background-color: var(--light-color);
    font-weight: 600;
}

.matrix-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.matrix-table input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Ranking */
.ranking-list {
    list-style: none;
    padding: 0;
}

.ranking-item {
    background: var(--light-color);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background-color 0.3s ease;
}

.ranking-item:hover {
    background-color: #e9ecef;
}

.ranking-item .drag-handle {
    font-size: 20px;
    color: var(--secondary-color);
}

.ranking-item .rank-number {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 30px;
}

/* Navigation Buttons */
.survey-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Admin Dashboard */
.dashboard-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card i {
    font-size: 40px;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 32px;
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--secondary-color);
}

/* Data Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.table thead {
    background-color: var(--light-color);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--dark-color);
}

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

.table-actions {
    display: flex;
    gap: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-close:hover {
    color: var(--dark-color);
}

/* Charts */
.chart-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* Multi-select "Other" option styles */
.form-check.other-option {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
}

.other-text-container {
    margin-left: 30px;
    margin-top: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.other-text-input {
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.other-text-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.other-text-input.error {
    border-color: var(--danger-color);
    background-color: #fff5f5;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .surveys-grid {
        grid-template-columns: 1fr;
    }
    
    .survey-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .rating-scale,
    .likert-scale {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .other-text-container {
        margin-left: 15px;
    }
}
