/* Student Voice System — التصويتات والاستبيانات */

.sv-admin .dashboard-header { margin-bottom: 20px; }

.sv-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.sv-tab {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.sv-tab.active,
.sv-tab:hover {
    background: #fff;
    color: #6C4CF1;
    box-shadow: 0 2px 8px rgba(108, 76, 241, 0.12);
}

.sv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sv-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.sv-dash-card {
    padding: 20px;
    border-radius: 14px;
}

.sv-dash-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 1rem;
    color: #1e293b;
}

.sv-top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}

.sv-pri {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.sv-pri--high { background: #fef2f2; color: #dc2626; }
.sv-pri--medium { background: #fffbeb; color: #d97706; }
.sv-pri--low { background: #f0fdf4; color: #16a34a; }

.sv-modal-wide { max-width: 720px !important; width: 95% !important; }

.sv-section-title {
    font-weight: 800;
    color: #334155;
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #6C4CF1;
    font-size: 0.9rem;
}

.sv-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.sv-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #334155;
    cursor: pointer;
}

.sv-option-row { margin-bottom: 8px; }
.sv-option-row input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1; }

.sv-results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.sv-rstat {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.sv-rstat strong { display: block; font-size: 1.6rem; color: #6C4CF1; }
.sv-rstat span { font-size: 0.8rem; color: #64748b; }

.sv-result-bar { margin-bottom: 12px; }
.sv-result-bar__head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.88rem; }

.sv-progress {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.sv-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #6C4CF1, #8b5cf6);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.sv-rating-result { text-align: center; padding: 20px; }
.sv-rating-big { font-size: 2.5rem; font-weight: 800; color: #6C4CF1; display: block; }

.sv-open-answer {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    border-right: 3px solid #6C4CF1;
}

.sv-loading { text-align: center; padding: 40px; color: #64748b; }

.sv-status-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 0.82rem;
}

/* Student card */
.sv-student-card { position: relative; }
.sv-notif-dot {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: sv-pulse 1.5s infinite;
}

@keyframes sv-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.sv-student-actions { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }

/* Fullscreen portal */
.sv-portal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}

.sv-portal.hidden { display: none !important; }

.sv-portal-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
    overflow: hidden;
    animation: sv-slideUp 0.3s ease;
}

@keyframes sv-slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.sv-portal-header {
    padding: 20px 20px 12px;
    background: linear-gradient(135deg, #6C4CF1 0%, #8b5cf6 100%);
    color: #fff;
    position: relative;
}

.sv-portal-header h2 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sv-portal-header p { margin: 0; opacity: 0.9; font-size: 0.85rem; }

.sv-portal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-portal-tabs {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch;
}

.sv-ptab {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.sv-ptab.active { background: #fff; color: #6C4CF1; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.sv-portal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.sv-poll-card {
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
    animation: sv-fadeIn 0.3s ease;
}

.sv-poll-card--important { border-color: #fecaca; background: #fffbfb; }

@keyframes sv-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sv-poll-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.sv-poll-card h4 { margin: 0 0 8px; font-size: 1.05rem; color: #0f172a; }

.sv-poll-meta { font-size: 0.78rem; color: #64748b; display: flex; align-items: center; gap: 4px; }

.sv-participants { font-size: 0.82rem; color: #64748b; margin: 8px 0 14px; display: flex; align-items: center; gap: 6px; }

.sv-vote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sv-vote-options { display: flex; flex-direction: column; gap: 10px; }

.sv-radio, .sv-vote-options .sv-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 0.92rem;
}

.sv-rating-vote .sv-stars { display: flex; gap: 8px; justify-content: center; }

.sv-star-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    color: #6C4CF1;
    cursor: pointer;
    transition: all 0.15s;
}

.sv-star-btn:hover, .sv-star-btn:active {
    background: #6C4CF1;
    color: #fff;
    border-color: #6C4CF1;
    transform: scale(1.05);
}

.sv-open-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    margin-bottom: 10px;
    resize: vertical;
}

.sv-voted-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #059669;
    font-weight: 700;
    padding: 12px;
    background: #ecfdf5;
    border-radius: 10px;
}

.sv-empty { text-align: center; padding: 40px 20px; color: #94a3b8; }
.sv-empty i { width: 48px; height: 48px; margin-bottom: 12px; }

.sv-suggest-form { padding: 16px; border-radius: 14px; margin-bottom: 16px; }
.sv-suggest-form h4 { margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

.sv-sug-item { padding: 14px; border-radius: 12px; margin-bottom: 10px; }
.sv-sug-item .badge { margin-right: 8px; }
.sv-admin-reply {
    margin-top: 10px;
    padding: 10px;
    background: #eff6ff;
    border-radius: 8px;
    font-size: 0.88rem;
    border-right: 3px solid #2563eb;
}

.sv-voted-card { padding: 14px; border-radius: 12px; margin-bottom: 10px; }

.sv-actions {
    flex-wrap: nowrap;
    gap: 6px;
}

.sv-act-btn {
    min-width: 38px;
    min-height: 38px;
    position: relative;
    z-index: 3;
    cursor: pointer;
    pointer-events: auto !important;
}

.sv-act-btn i,
.sv-act-btn svg {
    pointer-events: none;
}

.sv-status-badge {
    font-weight: 700;
    min-width: 56px;
    display: inline-block;
    text-align: center;
}

.sv-delete-preview {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.88rem;
    color: #334155;
}

.sv-delete-preview p { margin: 4px 0; }

.sv-polls-table .table-actions {
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .sv-portal-inner { max-width: 100%; border-radius: 0; }
    .sv-results-stats { grid-template-columns: 1fr; }
    .sv-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .sv-tab { white-space: nowrap; }
    .sv-star-btn { width: 52px; height: 52px; }
    .sv-act-btn {
        min-width: 44px;
        min-height: 44px;
    }
}
