/* ═══════════════════════════════════════════
   Gov Assessment - Public Frontend CSS (RTL)
   واجهة التقييم الذاتي للأعضاء
   ═══════════════════════════════════════════ */

:root {
    --gov-primary: #1a5276;
    --gov-primary-light: #2980b9;
    --gov-success: #27ae60;
    --gov-warning: #f39c12;
    --gov-danger: #e74c3c;
    --gov-dark: #2c3e50;
    --gov-gray: #7f8c8d;
    --gov-light: #ecf0f1;
    --gov-white: #ffffff;
    --gov-border: #dde1e5;
    --gov-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --gov-radius: 8px;
}

/* Base */
.gov-public { direction: rtl; text-align: right; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; max-width: 960px; margin: 0 auto; padding: 20px; color: var(--gov-dark); line-height: 1.7; }
.gov-public * { box-sizing: border-box; }
.gov-public h2 { font-size: 24px; color: var(--gov-primary); margin: 0 0 8px; }
.gov-public h3 { font-size: 18px; color: var(--gov-dark); margin: 20px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gov-light); }
.gov-public h4 { font-size: 15px; margin: 0 0 8px; }

/* Header */
.gov-public-header { text-align: center; padding: 25px 0 15px; border-bottom: 2px solid var(--gov-primary); margin-bottom: 25px; }
.gov-subtitle { color: var(--gov-gray); font-size: 14px; margin: 0; }

/* Cards Grid */
.gov-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin: 20px 0; }
.gov-card { background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); padding: 18px; display: flex; align-items: center; gap: 15px; box-shadow: var(--gov-shadow); transition: transform 0.2s; }
.gov-card:hover { transform: translateY(-2px); }
.gov-card-blue { border-right: 4px solid var(--gov-primary); }
.gov-card-green { border-right: 4px solid var(--gov-success); }
.gov-card-orange { border-right: 4px solid var(--gov-warning); }
.gov-card-icon { font-size: 32px; opacity: 0.8; }
.gov-card-value { font-size: 20px; font-weight: bold; color: var(--gov-dark); }
.gov-card-label { font-size: 13px; color: var(--gov-gray); }

/* Sections */
.gov-section { margin: 25px 0; }

/* Committee badges */
.gov-committees-list { display: flex; flex-wrap: wrap; gap: 10px; }
.gov-committee-badge { background: var(--gov-light); border: 1px solid var(--gov-border); border-radius: 20px; padding: 8px 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gov-role-badge { background: var(--gov-primary); color: white; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ★ Interactive committee cards */
.gov-committees-interactive { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.gov-committee-card { background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); padding: 18px; box-shadow: var(--gov-shadow); transition: transform 0.2s, box-shadow 0.2s; }
.gov-committee-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.gov-committee-card-header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gov-committee-card-title { display: flex; justify-content: space-between; align-items: center; }
.gov-committee-card-title strong { font-size: 15px; color: var(--gov-dark); }
.gov-committee-status { font-size: 13px; font-weight: 600; }
.gov-committee-card-progress { margin: 10px 0; display: flex; align-items: center; gap: 10px; }
.gov-committee-card-progress .gov-progress-bar { flex: 1; }
.gov-committee-card-action { text-align: center; margin-top: 12px; }

/* Committee card states */
.gov-committee-not_started { border-right: 4px solid #3498db; }
.gov-committee-in_progress { border-right: 4px solid #f39c12; }
.gov-committee-completed { border-right: 4px solid #28a745; }
.gov-committee-waiting { border-right: 4px solid #95a5a6; opacity: 0.7; }

/* Button variants */
.gov-btn-sm { padding: 6px 16px; font-size: 13px; }
.gov-btn-success { background: var(--gov-success); color: white; border-color: var(--gov-success); }
.gov-btn-success:hover { background: #219a52; border-color: #219a52; color: white; }

/* ★ Results banner */
.gov-results-banner { display: flex; align-items: center; gap: 20px; padding: 25px; background: linear-gradient(135deg, #eaf4fe 0%, #d4edda 100%); border: 1px solid #bee5eb; border-radius: var(--gov-radius); }
.gov-results-banner-icon { font-size: 48px; }
.gov-results-banner-content { flex: 1; }
.gov-results-banner-content h3 { margin: 0 0 4px; border: none; padding: 0; font-size: 18px; color: var(--gov-primary); }
.gov-results-banner-content p { margin: 0; font-size: 14px; color: var(--gov-gray); }

/* Cycle card */
.gov-cycle-card { background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); padding: 18px; margin: 10px 0; display: flex; align-items: center; gap: 15px; box-shadow: var(--gov-shadow); flex-wrap: wrap; }
.gov-cycle-info { flex: 1; min-width: 200px; }
.gov-cycle-info h4 { margin: 0 0 4px; }
.gov-cycle-dates { font-size: 12px; color: var(--gov-gray); direction: ltr; display: inline-block; }
.gov-cycle-progress { flex: 1; min-width: 150px; }
.gov-cycle-link { display: block; padding: 12px 18px; margin: 8px 0; background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); text-decoration: none; color: var(--gov-dark); transition: background 0.2s; }
.gov-cycle-link:hover { background: var(--gov-light); }

/* Progress bars */
.gov-progress-bar { background: #e9ecef; border-radius: 10px; height: 14px; overflow: hidden; }
.gov-progress-bar-lg { height: 22px; }
.gov-progress-fill { height: 100%; border-radius: 10px; background: var(--gov-primary-light); transition: width 0.5s ease; min-width: 2px; }
.gov-progress-text { font-size: 13px; font-weight: bold; color: var(--gov-dark); margin-top: 4px; display: inline-block; }
.gov-progress-section { background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); padding: 15px 20px; margin: 15px 0; }
.gov-progress-stats { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }

/* Notices */
.gov-notice { padding: 14px 18px; border-radius: var(--gov-radius); margin: 12px 0; font-size: 14px; }
.gov-notice-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.gov-notice-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.gov-notice-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.gov-notice-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Buttons */
.gov-btn { display: inline-block; padding: 8px 20px; border-radius: 6px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; text-align: center; }
.gov-btn-primary { background: var(--gov-primary); color: white; border-color: var(--gov-primary); }
.gov-btn-primary:hover { background: var(--gov-primary-light); border-color: var(--gov-primary-light); color: white; }
.gov-btn-outline { background: transparent; color: var(--gov-primary); border-color: var(--gov-primary); }
.gov-btn-outline:hover { background: var(--gov-primary); color: white; }
.gov-btn-lg { padding: 12px 30px; font-size: 16px; }

/* Login prompt */
.gov-login-prompt { text-align: center; padding: 60px 20px; background: var(--gov-light); border-radius: var(--gov-radius); }
.gov-login-icon { font-size: 64px; margin-bottom: 15px; }
.gov-login-prompt h3 { border: none; }

/* Instructions */
.gov-instructions { background: #eaf4fe; border: 1px solid #bddcf5; border-radius: var(--gov-radius); padding: 15px 20px; margin: 15px 0; }
.gov-instructions h4 { color: var(--gov-primary); margin-top: 0; }
.gov-scale-guide { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gov-scale-item { padding: 5px 12px; border-radius: 15px; font-size: 12px; }
.gov-scale-0 { background: #f8d7da; color: #721c24; }
.gov-scale-1 { background: #fff3cd; color: #856404; }
.gov-scale-2 { background: #d1ecf1; color: #0c5460; }
.gov-scale-3 { background: #d4edda; color: #155724; }

/* Section navigation tabs */
.gov-section-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0; padding: 10px; background: var(--gov-light); border-radius: var(--gov-radius); position: sticky; top: 0; z-index: 100; }
.gov-section-tab { background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all 0.2s; color: var(--gov-dark); }
.gov-section-tab:hover { background: var(--gov-primary-light); color: white; border-color: var(--gov-primary-light); }
.gov-section-tab.active { background: var(--gov-primary); color: white; border-color: var(--gov-primary); }
.gov-tab-count { font-size: 11px; opacity: 0.8; }

/* Question cards */
.gov-question-section { margin: 15px 0; }
.gov-section-title { font-size: 18px; color: var(--gov-primary); padding: 10px 0; border-bottom: 2px solid var(--gov-primary); margin-bottom: 15px; }
.gov-section-title small { font-weight: normal; color: var(--gov-gray); font-size: 13px; }

.gov-question-card { background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); padding: 16px; margin: 10px 0; transition: border-color 0.2s, box-shadow 0.2s; }
.gov-question-card:hover { box-shadow: var(--gov-shadow); }
.gov-q-answered { border-right: 4px solid var(--gov-success); }

.gov-question-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gov-q-code { font-size: 12px; font-weight: bold; color: var(--gov-primary); background: #eaf4fe; padding: 2px 8px; border-radius: 4px; }
.gov-q-required { font-size: 11px; color: var(--gov-warning); background: #fff8e1; padding: 2px 8px; border-radius: 4px; }
.gov-question-text { font-size: 14px; line-height: 1.8; margin-bottom: 12px; color: #333; }

/* Answer radio group */
.gov-answer-group { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.gov-answer-option { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--gov-border); border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.gov-answer-option:hover { border-color: var(--gov-primary-light); background: #f0f8ff; }
.gov-answer-option.selected { border-color: var(--gov-primary); background: #eaf4fe; }
.gov-answer-option input[type="radio"] { display: none; }
.gov-answer-value { font-weight: bold; font-size: 16px; color: var(--gov-primary); min-width: 18px; text-align: center; }
.gov-answer-label { color: var(--gov-gray); font-size: 12px; }

/* Note input */
.gov-note-input { width: 100%; border: 1px solid #e0e0e0; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-top: 8px; direction: rtl; background: #fafafa; }
.gov-note-input:focus { border-color: var(--gov-primary-light); background: white; outline: none; }

/* Submit bar */
.gov-submit-bar { position: sticky; bottom: 0; background: var(--gov-white); border: 1px solid var(--gov-border); border-radius: var(--gov-radius); padding: 15px 20px; margin-top: 20px; display: flex; justify-content: center; gap: 12px; box-shadow: 0 -4px 12px rgba(0,0,0,0.1); z-index: 100; }

/* Results */
.gov-result-overall { text-align: center; padding: 30px; margin: 20px 0; background: var(--gov-white); border-radius: var(--gov-radius); box-shadow: var(--gov-shadow); }
.gov-result-score-big { font-size: 64px; font-weight: bold; color: var(--gov-primary); }
.gov-result-score-big small { font-size: 24px; color: var(--gov-gray); }
.gov-result-level { font-size: 20px; margin-top: 10px; }
.gov-result-stats { display: flex; justify-content: center; gap: 20px; margin-top: 15px; font-size: 14px; color: var(--gov-gray); }
.gov-result-bar-item { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.gov-result-bar-label { min-width: 180px; font-size: 13px; font-weight: 600; }
.gov-result-bar-item .gov-progress-bar { flex: 1; }
.gov-result-bar-score { min-width: 60px; font-size: 13px; font-weight: bold; text-align: center; }

/* ★ Results section grid (clickable cards) */
.gov-results-sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.gov-result-section-card { display: block; background: var(--gov-white); border: 1px solid var(--gov-border); border-right: 4px solid var(--gov-primary); border-radius: var(--gov-radius); padding: 16px; text-decoration: none; color: var(--gov-dark); box-shadow: var(--gov-shadow); transition: transform 0.2s, box-shadow 0.2s; }
.gov-result-section-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); color: var(--gov-dark); }
.gov-result-section-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gov-result-section-card-header strong { font-size: 14px; }
.gov-result-section-card-footer { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--gov-gray); }

/* ★ Section detail header */
.gov-section-detail-header { background: var(--gov-white); border: 1px solid var(--gov-border); border-right: 5px solid var(--gov-primary); border-radius: var(--gov-radius); padding: 20px; box-shadow: var(--gov-shadow); }
.gov-section-detail-header h3 { margin: 0 0 12px; padding: 0; border: none; font-size: 20px; color: var(--gov-primary); }
.gov-section-detail-stats { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; flex-wrap: wrap; }
.gov-section-detail-score { font-size: 36px; font-weight: bold; }
.gov-section-detail-meta { font-size: 13px; color: var(--gov-gray); }

/* ★ Gap cards */
.gov-gaps-list { display: flex; flex-direction: column; gap: 12px; }
.gov-gap-card { background: var(--gov-white); border: 1px solid var(--gov-border); border-right: 4px solid var(--gov-danger); border-radius: var(--gov-radius); padding: 15px; box-shadow: var(--gov-shadow); }
.gov-gap-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gov-gap-priority { color: white; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.gov-gap-card-text { font-size: 14px; line-height: 1.8; margin-bottom: 10px; color: #333; }
.gov-gap-card-scores { display: flex; gap: 15px; flex-wrap: wrap; font-size: 13px; color: var(--gov-gray); }

/* Responsive */
@media (max-width: 768px) {
    .gov-public { padding: 10px; }
    .gov-cards-grid { grid-template-columns: 1fr; }
    .gov-committees-interactive { grid-template-columns: 1fr; }
    .gov-cycle-card { flex-direction: column; }
    .gov-answer-group { flex-direction: column; }
    .gov-answer-option { width: 100%; }
    .gov-section-nav { flex-direction: column; position: static; }
    .gov-submit-bar { flex-direction: column; position: static; }
    .gov-result-bar-item { flex-direction: column; align-items: stretch; }
    .gov-result-bar-label { min-width: auto; }
    .gov-results-sections-grid { grid-template-columns: 1fr; }
    .gov-results-banner { flex-direction: column; text-align: center; }
    .gov-gap-card-scores { flex-direction: column; gap: 5px; }
    .gov-section-detail-stats { flex-direction: column; }
    .gov-result-stats { flex-direction: column; gap: 8px; }
}

/* Print */
@media print {
    .gov-submit-bar, .gov-section-nav, .gov-btn { display: none !important; }
    .gov-question-section { display: block !important; }
    .gov-question-card { break-inside: avoid; }
}
