/* ===== استایل‌های بخش نظرسنجی ===== */

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

body {
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 25px;
}

/* ===== هدر ===== */
.main-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}
.main-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}
.main-header p {
    opacity: 0.9;
    font-size: 14px;
}
.back-link {
    display: inline-block;
    color: #ffd700;
    text-decoration: none;
    margin-top: 8px;
    font-weight: 600;
    font-size: 14px;
}
.back-link:hover {
    text-decoration: underline;
}

/* ===== نوار مدیریت ===== */
.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-bar .admin-info {
    font-size: 13px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-bar .admin-info .admin-name {
    color: #3498db;
    font-weight: bold;
}
.admin-bar .logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}
.admin-bar .logout-btn:hover {
    background: #c82333;
}

/* ===== دکمه‌ها ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: Tahoma;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.btn-primary {
    background: #3498db;
    color: white;
}
.btn-primary:hover {
    background: #2980b9;
}
.btn-success {
    background: #28a745;
    color: white;
}
.btn-success:hover {
    background: #218838;
}
.btn-danger {
    background: #dc3545;
    color: white;
}
.btn-danger:hover {
    background: #c82333;
}
.btn-warning {
    background: #ffc107;
    color: #2c3e50;
}
.btn-warning:hover {
    background: #e0a800;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== فرم‌ها ===== */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}
.form-group label .required {
    color: #dc3545;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: Tahoma;
    font-size: 15px;
    transition: border 0.3s;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
}
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* ===== نظرسنجی ===== */
.survey-question {
    background: #f8f9fa;
    padding: 15px 18px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}
.survey-question:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52,152,219,0.08);
}
.survey-question .q-text {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 8px;
}
.survey-question .q-category {
    font-size: 11px;
    color: #7f8c8d;
    background: #e9ecef;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 6px;
}
.survey-question .stars {
    display: flex;
    gap: 8px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.survey-question .stars label {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.survey-question .stars label:hover,
.survey-question .stars label:hover ~ label {
    color: #f1c40f;
}
.survey-question .stars input[type="radio"] {
    display: none;
}
.survey-question .stars input[type="radio"]:checked ~ label {
    color: #f1c40f;
}
.survey-question .stars input[type="radio"]:checked + label {
    color: #f1c40f;
}
.survey-question .stars input[type="radio"]:checked ~ label {
    color: #f1c40f;
}
/* اصلاح برای رعایت راست‌چینی */
.survey-question .stars {
    display: flex;
    gap: 8px;
    flex-direction: row;
    justify-content: flex-start;
}
.survey-question .stars input[type="radio"] {
    display: none;
}
.survey-question .stars label {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    order: 1;
}
.survey-question .stars label:hover,
.survey-question .stars label:hover ~ label {
    color: #f1c40f;
}
.survey-question .stars input[type="radio"]:checked ~ label {
    color: #f1c40f;
}

/* ===== نتایج ===== */
.stats-box {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 12px;
    margin-top: 25px;
    border: 1px solid #dee2e6;
}
.stats-box .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.stats-box .stat-row:last-child {
    border-bottom: none;
}
.stats-box .stat-label {
    font-weight: 600;
    color: #2c3e50;
}
.stats-box .stat-value {
    font-weight: 700;
    color: #3498db;
}
.stats-box .stat-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}
.stats-box .stat-bar .fill {
    height: 100%;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 4px;
    transition: width 0.8s ease;
}
.stats-box .stat-count {
    font-size: 13px;
    color: #7f8c8d;
    min-width: 40px;
    text-align: left;
}
.avg-display {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #3498db;
    margin-bottom: 15px;
}
.avg-display .number {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
}
.avg-display .stars-display {
    font-size: 28px;
    color: #f1c40f;
}
.avg-display .label {
    font-size: 14px;
    color: #7f8c8d;
}
.avg-display .total {
    font-size: 13px;
    color: #7f8c8d;
}

/* ===== پیام‌ها ===== */
.notification {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    font-weight: 600;
}
.notification.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.notification.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.notification.info {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
}
.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 8px;
}

/* ===== لیست سوالات در مدیریت ===== */
.question-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}
.question-item .q-order {
    font-weight: 700;
    color: #3498db;
    min-width: 30px;
}
.question-item .q-text {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}
.question-item .q-category {
    font-size: 12px;
    color: #7f8c8d;
    background: #e9ecef;
    padding: 2px 10px;
    border-radius: 20px;
}
.question-item .q-status {
    font-size: 12px;
    font-weight: 600;
}
.question-item .q-status.active {
    color: #28a745;
}
.question-item .q-status.inactive {
    color: #dc3545;
}
.question-item .q-actions {
    display: flex;
    gap: 6px;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 600px) {
    .container { padding: 15px; }
    .main-header h1 { font-size: 20px; }
    .main-header p { font-size: 13px; }
    .admin-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .survey-question { padding: 12px 14px; }
    .survey-question .stars label { font-size: 28px; }
    .question-item { flex-direction: column; align-items: stretch; text-align: center; }
    .question-item .q-actions { justify-content: center; }
    .stats-box .stat-row { flex-wrap: wrap; gap: 4px; }
    .stats-box .stat-bar { width: 100%; margin: 4px 0; }
    .avg-display .number { font-size: 28px; }
    .avg-display .stars-display { font-size: 22px; }
}

@media (max-width: 400px) {
    body { padding: 8px; }
    .container { padding: 10px; border-radius: 10px; }
    .main-header { padding: 15px; }
    .main-header h1 { font-size: 17px; }
    .survey-question .stars label { font-size: 24px; }
    .survey-question .q-text { font-size: 13px; }
    .btn { font-size: 13px; padding: 8px 14px; }
    .btn-sm { font-size: 11px; padding: 4px 10px; }
}