/* ============================================================
   SLIDESHOW.CSS  –  وضع العرض التلفزيوني للوحة الشرف
   ============================================================ */

/* ---- RESET / BASE ---- */
.slideshow-body {
    margin: 0;
    padding: 0;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--bg-grad-1, #4a148c) 0%, var(--bg-grad-2, #0d47a1) 100%);
    background-attachment: fixed;
    transition: background 1s ease;
    font-family: 'Almarai', sans-serif;
    direction: rtl;
    box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }

/* ============================================================
   HEADER
   ============================================================ */
.sv-header {
    flex-shrink: 0;
    padding: 14px 30px 12px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.sv-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Logos */
.sv-logo-wrap {
    flex: 0 0 auto;
    width: clamp(50px, 7vw, 90px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-logo {
    max-height: clamp(40px, 6vw, 80px);
    max-width: clamp(50px, 7vw, 90px);
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
    transition: transform 0.4s;
}

.sv-logo:hover { transform: scale(1.05); }

/* Center */
.sv-header-center {
    flex: 1;
    text-align: center;
    color: white;
}

.sv-site-label {
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--secondary-color, #ffc107);
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.sv-school-name {
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category badge */
.sv-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 4px 16px;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: white;
    backdrop-filter: blur(6px);
    animation: badgePulse 3s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.2); }
    50%       { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.sv-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding: 18px 30px 10px;
}

/* Slide title */
.sv-slide-title {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 14px);
    color: white;
    font-size: clamp(1.1rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: clamp(10px, 2vh, 18px);
    text-align: center;
    text-shadow: 0 3px 12px rgba(0,0,0,0.5);
    animation: slideInDown 0.5s cubic-bezier(.34,1.56,.64,1) both;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.3;
}

.sv-level-name {
    color: var(--secondary-color, #ffc107);
}

.sv-sep {
    opacity: 0.5;
    font-weight: 300;
}

.sv-class-name {
    color: rgba(255,255,255,0.9);
}

/* Tab Subtitle — shown in header below category badge */
.sv-tab-subtitle {
    font-size: clamp(0.75rem, 1.3vw, 0.95rem);
    color: rgba(255,255,255,0.8);
    font-weight: 700;
    text-align: center;
    margin-top: 5px;
    letter-spacing: 0.5px;
    min-height: 1.2em;
}

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

/* ============================================================
   STUDENTS GRID
   ============================================================ */
.sv-students-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: clamp(10px, 1.8vw, 20px);
    width: 100%;
    max-width: 1700px;
    overflow-y: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    flex: 1;
}
.sv-students-grid::-webkit-scrollbar { display: none; }

/* ============================================================
   STUDENT CARD
   ============================================================ */
.sv-student-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.88), rgba(255,255,255,0.55));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    border-bottom: 6px solid var(--secondary-color, #ffc107);
    padding: clamp(12px, 2vw, 22px) clamp(10px, 1.5vw, 18px) clamp(10px, 1.5vw, 18px);
    text-align: center;
    width: clamp(130px, 18vw, 200px);
    box-shadow:
        0 8px 30px rgba(0,0,0,0.2),
        inset 0 1px 1px rgba(255,255,255,0.5);
    animation: cardPop 0.5s cubic-bezier(.34,1.56,.64,1) both;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.sv-student-card:hover {
    transform: translateY(-6px) scale(1.04);
}

@keyframes cardPop {
    from { opacity: 0; transform: scale(0.7) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Avatar */
.sv-avatar {
    width: clamp(70px, 10vw, 120px);
    height: clamp(70px, 10vw, 120px);
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    margin: 0 auto clamp(8px, 1.2vw, 12px);
    display: block;
    background: #f3e5f5;
    transition: transform 0.4s;
}

.sv-student-card:hover .sv-avatar {
    transform: rotate(5deg) scale(1.1);
}

/* Name */
.sv-student-name {
    font-size: clamp(0.85rem, 1.4vw, 1.25rem);
    font-weight: 800;
    color: var(--primary-color, #4a148c);
    margin-bottom: 6px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Score */
.sv-score {
    display: inline-block;
    background: var(--secondary-color, #ffc107);
    color: #333;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

/* Rank */
.sv-rank {
    display: table;
    margin: 4px auto 0;
    padding: 4px 16px;
    border: 2px solid var(--primary-color, #4a148c);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color, #4a148c);
    background: rgba(74,20,140,0.06);
    animation: pulseShadow 2s infinite;
}

@keyframes pulseShadow {
    0%   { box-shadow: 0 0 0 0 rgba(74,20,140,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(74,20,140,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,20,140,0); }
}

/* Phrase (behavior / discipline) */
.sv-phrase {
    font-size: 0.9rem;
    color: var(--primary-color, #4a148c);
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    padding: 5px 10px;
    margin-top: 6px;
    line-height: 1.4;
    border: 1px solid rgba(0,0,0,0.08);
}

/* ============================================================
   EMPTY MESSAGE
   ============================================================ */
.sv-empty {
    color: rgba(255,255,255,0.8);
    font-size: 1.5rem;
    text-align: center;
    margin-top: 60px;
}

/* ============================================================
   PRINCIPAL WORD SLIDE
   ============================================================ */
.sv-principal-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 30px 20px;
    width: 100%;
    animation: slideInDown 0.6s cubic-bezier(.34,1.56,.64,1) both;
}

.sv-principal-frame {
    background: linear-gradient(160deg, rgba(255,255,255,0.92), rgba(255,255,255,0.75));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 24px;
    padding: 40px 60px;
    max-width: 900px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.25),
        inset 0 1px 1px rgba(255,255,255,0.6);
}

/* Golden inner border decoration */
.sv-principal-frame::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 16px;
    pointer-events: none;
}

/* Corner ornaments */
.sv-principal-frame::after {
    content: '❧';
    position: absolute;
    top: 16px;
    right: 50%;
    transform: translateX(50%);
    font-size: 1.6rem;
    color: var(--secondary-color, #ffc107);
    opacity: 0.8;
}

.sv-principal-word {
    font-size: 1.55rem;
    font-weight: 700;
    color: #2d2d2d;
    line-height: 2;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.sv-principal-sig-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 18px;
    margin-top: 10px;
}

.sv-principal-sig-img {
    max-height: 80px;
    max-width: 220px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.sv-principal-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color, #4a148c);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sv-principal-frame   { padding: 24px 20px; }
    .sv-principal-word    { font-size: 1.1rem; line-height: 1.8; }
    .sv-principal-sig-img { max-height: 55px; }
}


.sv-no-slides {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    text-align: center;
    gap: 16px;
    background: linear-gradient(135deg, #4a148c, #0d47a1);
    z-index: 999;
}

.sv-back-link {
    color: var(--secondary-color, #ffc107);
    text-decoration: none;
    font-size: 1.1rem;
    margin-top: 10px;
    padding: 10px 28px;
    border: 2px solid currentColor;
    border-radius: 30px;
    transition: 0.3s;
}
.sv-back-link:hover { background: rgba(255,255,255,0.1); }

/* ============================================================
   FOOTER / CONTROLS
   ============================================================ */
.sv-footer {
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: clamp(6px, 1.2vh, 10px) clamp(10px, 2vw, 24px);
}

.sv-footer-inner {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 16px);
    max-width: 1600px;
    margin: 0 auto;
}

/* Slide counter */
.sv-counter {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}

/* Progress bar */
.sv-progress-wrap {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    overflow: hidden;
}

.sv-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary-color, #ffc107), #ff9800);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
}

/* Control Buttons */
.sv-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sv-btn {
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 10px;
    padding: 6px 16px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.25s;
    backdrop-filter: blur(6px);
    line-height: 1;
}

.sv-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: scale(1.08);
}

.sv-btn-pause {
    background: rgba(255,193,7,0.2);
    border-color: rgba(255,193,7,0.5);
}

.sv-btn-fs {
    font-size: 1.3rem;
    padding: 4px 12px;
}

/* ============================================================
   RESPONSIVE — from 360px mobile up to 4K TV
   ============================================================ */

/* 4K / large TV */
@media (min-width: 1920px) {
    .sv-school-name    { font-size: 2.2rem; }
    .sv-slide-title    { font-size: 2.8rem; }
    .sv-student-card   { width: 230px; }
    .sv-avatar         { width: 150px; height: 150px; }
    .sv-student-name   { font-size: 1.5rem; }
    .sv-principal-word { font-size: 1.8rem; }
}

/* Tablet landscape / small laptop */
@media (max-width: 1024px) {
    .sv-header { padding: 10px 20px 8px; }
    .sv-main   { padding: 12px 16px 8px; }
    .sv-principal-frame { padding: 28px 32px; }
    .sv-principal-word  { font-size: 1.25rem; }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .sv-header { padding: 8px 14px 6px; }
    .sv-header-inner { gap: 10px; }
    .sv-site-label { font-size: clamp(0.95rem, 3.5vw, 1.2rem); }
    .sv-school-name { font-size: clamp(0.72rem, 2.5vw, 0.9rem); }
    .sv-main { padding: 10px 12px 6px; }
    .sv-principal-frame { padding: 20px 16px; }
    .sv-principal-word  { font-size: 1rem; line-height: 1.8; margin-bottom: 12px; }
    .sv-principal-sig-img { max-height: 52px; }
    .sv-principal-name { font-size: 0.9rem; }
}

/* Mobile (max 480px) */
@media (max-width: 480px) {
    .sv-logo-wrap { width: 38px; }
    .sv-logo { max-height: 34px; max-width: 38px; }
    .sv-students-grid { gap: 8px; }
    .sv-student-card {
        width: clamp(100px, 42vw, 138px);
        padding: 10px 6px 8px;
        border-radius: 14px;
        border-bottom-width: 4px;
    }
    .sv-score, .sv-rank { font-size: 0.76rem; padding: 2px 8px; }
    .sv-principal-frame { padding: 14px 10px; border-radius: 14px; }
    .sv-principal-word  { font-size: 0.88rem; line-height: 1.65; margin-bottom: 10px; }
    .sv-principal-sig-img { max-height: 42px; }
    .sv-btn { padding: 5px 10px; font-size: 0.85rem; }
    .sv-btn-fs { display: none; }
}

/* Very small phones */
@media (max-width: 360px) {
    .sv-logo-wrap { display: none; }
    .sv-student-card { width: clamp(88px, 44vw, 115px); }
    .sv-counter { display: none; }
}
