/* =============================================
   SINAV SONUÇLARI - FRONTEND CSS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --ss-yellow: #FFD700;
    --ss-yellow-dark: #e6c200;
    --ss-green: #4CAF50;
    --ss-green-dark: #388E3C;
    --ss-purple: #9C27B0;
    --ss-purple-dark: #6A1B9A;
    --ss-purple-light: #CE93D8;
    --ss-lgs-color: #8e44ad;
    --ss-radius: 12px;
    --ss-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.ss-frontend-container * {
    font-family: 'Inter', -apple-system, sans-serif;
    box-sizing: border-box;
}

/* =============================================
   3 ANA BÖLÜM GRID YAPISI
   ============================================= */
.ss-main-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 2px solid #ddd;
    border-radius: var(--ss-radius);
    overflow: hidden;
    box-shadow: var(--ss-shadow);
    background: #fff;
}

/* =============================================
   ANA BÖLÜM
   ============================================= */
.ss-main-section {
    border-right: 2px solid #ddd;
    display: flex;
    flex-direction: column;
}

.ss-main-section:last-child {
    border-right: none;
}

/* =============================================
   BÖLÜM BAŞLIĞI (Sarı / Yeşil / Mor)
   ============================================= */
.ss-section-header {
    padding: 14px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-bottom: 2px solid rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Section header colors are now dynamic from PHP */

.ss-section-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.3;
    color: inherit;
}

/* Section icons removed as requested */

.ss-lock-badge {
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,0.15);
    padding: 2px 8px;
    border-radius: 20px;
}

/* =============================================
   ALT BÖLÜM LİSTESİ
   ============================================= */
.ss-subsections-list {
    flex: 1;
}

/* =============================================
   ALT BÖLÜM SATIRI
   ============================================= */
.ss-subsection-item {
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.ss-subsection-item:last-child {
    border-bottom: none;
}

/* Başlık Satırları (YKS / LGS Header) Renklendirme */
.ss-item-header {
    cursor: default !important;
    pointer-events: none;
}

/* YKS Başlıkları (Yeşil) */
.ss-item-header:not(.ss-lgs-highlight) {
    background: var(--ss-green) !important;
    color: #fff !important;
}

/* LGS Başlıkları (Mor) */
.ss-item-header.ss-lgs-highlight {
    background: var(--ss-purple) !important;
    color: #fff !important;
}

/* İlk satır özel kuralını (önceki koddan kalan) temizleyelim ki çakışmasın */
.ss-main-section .ss-subsection-item:first-child:not(.ss-item-header) {
    background: transparent;
    color: inherit;
}

.ss-item-header .ss-sub-name {
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* =============================================
   ALT BÖLÜM BAŞLIĞI
   ============================================= */
.ss-subsection-header {
    height: 42px; /* Sabit yükseklik eklendi */
    padding: 0 8px; /* Yükseklik sabitlendiği için dikey padding 0 yapıldı veya ayarlandı */
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.ss-sub-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.6;
}

.ss-subsection-item.open .ss-sub-arrow {
    transform: rotate(90deg);
    opacity: 1;
}

.ss-sub-name {
    flex: 1;
    line-height: 1.3;
}

.ss-sub-lock {
    font-size: 12px;
    opacity: 0.8;
}

/* =============================================
   AÇILAN İÇERİK
   ============================================= */
.ss-subsection-content {
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
}

/* =============================================
   BELGE KARTLARI
   ============================================= */
.ss-doc-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ss-doc-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.ss-doc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: #1a202c !important;
    transition: all 0.2s ease;
    cursor: pointer;
    flex: 1;
    min-width: 120px; /* Reduced from 200px */
}

.ss-doc-card:hover {
    border-color: var(--ss-purple);
    background: #faf5ff;
    box-shadow: 0 2px 10px rgba(156,39,176,0.15);
}

.ss-doc-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ss-icon-pdf   { background: #fee2e2; color: #dc2626 !important; }
.ss-icon-gorsel { background: #fef3c7; color: #ca8a04 !important; }
.ss-icon-word  { background: #e0e7ff; color: #2563eb !important; }
.ss-icon-excel { background: #dcfce7; color: #16a34a !important; }
.ss-icon-ppt   { background: #ffedd5; color: #ea580c !important; }
.ss-icon-video { background: #f3e8ff; color: #9333ea !important; }
.ss-icon-file  { background: #f1f5f9; color: #64748b !important; }

.ss-doc-icon i {
    color: inherit;
}

.ss-doc-info {
    flex: 1;
    min-width: 0;
}

.ss-doc-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ss-doc-meta {
    display: none;
}

.ss-doc-download-icon {
    font-size: 14px;
    color: var(--ss-purple);
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f0ff;
}

.ss-doc-card:hover .ss-doc-download-icon {
    color: #fff;
    background: var(--ss-purple);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(156,39,176,0.3);
}

/* Mobile specific touch target */
@media (max-width: 768px) {
    .ss-doc-card {
        padding: 14px;
        min-height: 60px;
    }

    .ss-doc-download-icon {
        color: #fff !important;
        background: var(--ss-purple) !important;
        font-size: 16px !important;
        width: 36px !important;
        height: 36px !important;
        box-shadow: 0 3px 10px rgba(156,39,176,0.4);
    }
}

/* =============================================
   YÜKLENİYOR
   ============================================= */
.ss-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #718096;
    font-size: 13px;
}

.ss-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--ss-purple);
    border-radius: 50%;
    animation: ss-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* =============================================
   BOŞ DURUM
   ============================================= */
.ss-no-docs {
    padding: 20px;
    text-align: center;
    color: #a0aec0;
    font-size: 13px;
}

.ss-no-docs-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

/* =============================================
   ŞİFRE MODAL
   ============================================= */
.ss-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ss-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: ss-fade-in 0.2s ease;
}

.ss-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: ss-slide-up 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes ss-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ss-slide-up {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ss-modal-header {
    background: linear-gradient(135deg, var(--ss-purple-dark), var(--ss-purple));
    color: #fff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ss-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff !important;
}

.ss-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    padding: 0;
}

.ss-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

.ss-modal-body {
    padding: 24px;
}

.ss-modal-body p {
    color: #4a5568;
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.6;
}

.ss-password-form {
    display: flex;
    gap: 10px;
}

.ss-password-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    letter-spacing: 3px;
    font-family: monospace;
    transition: border-color 0.2s;
    outline: none;
}

.ss-password-form input:focus {
    border-color: var(--ss-purple);
    box-shadow: 0 0 0 3px rgba(156,39,176,0.1);
}

.ss-btn-primary {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--ss-purple), var(--ss-purple-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ss-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(156,39,176,0.4);
}

.ss-error-msg {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #c53030;
    font-size: 13px;
    font-weight: 600;
    animation: ss-shake 0.4s ease;
}

@keyframes ss-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* =============================================
   RESPONSİF
   ============================================= */
@media (max-width: 768px) {
    .ss-main-sections {
        grid-template-columns: 1fr;
    }

    .ss-main-section {
        border-right: none;
        border-bottom: 2px solid #ddd;
    }

    .ss-main-section:last-child {
        border-bottom: none;
    }
}
