:root {
    --bg-color: #1a1a2e;
    --card-bg: #fff;
    --text-color: #333;
    --flip-speed: 1.5s;
    --accent-color: #3498db;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

/* OKUL BAŞLIĞI */
.school-header {
    width: 100%;
    height: 8vh;
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff !important;
    font-size: 3.2vh;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0.5vh 2vh rgba(0, 0, 0, 0.4);
    z-index: 1000;
    position: relative;
}

.school-header i {
    margin-right: 1vw;
    color: #3498db;
}

/* GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.5vh;
    padding: 1.5vh;
    height: 92vh;
}

/* ORTA SÜTUN */
.middle-column {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    height: 100%;
    overflow: hidden;
}

/* KART YAPISI */
.scene {
    width: 100%;
    height: 100%;
    perspective: 2000px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform var(--flip-speed) ease-in-out;
    transform-style: preserve-3d;
}

.card.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 2vh;
    overflow: hidden;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.5);
}

.card-back {
    transform: rotateY(180deg);
}

.panel-header {
    padding: 1vh 1.5vh;
    color: white;
    font-weight: 700;
    font-size: 2vh;
    display: flex;
    align-items: center;
    gap: 1vh;
    flex-shrink: 0;
}

.bg-red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.bg-blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.bg-green {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.bg-sky {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 2vh;
}

.panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1vh;
    background-color: #f8f9fa;
    gap: 0.6vh;
}

/* --- YEMEK & SINAV GÖRÜNÜMÜ --- */

/* Split Görünüm (YEMEK VARKEN) */
.split-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 !important;
    gap: 0 !important;
}

.split-view .counters-half {
    height: 55%;
    /* Sınav alanı genişletildi */
    width: 100%;
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    background: #ecf0f1;
    border-bottom: 2px solid #bdc3c7;
    padding: 0.5vh;
}

/* Eski counter-box stilleri (Yedek) */
.split-view .counter-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    height: 100%;
}

.split-view .counter-box:last-child {
    border-right: none;
}

.split-view .counter-box h3 {
    font-size: 1.6vh;
    margin-bottom: 0.5vh;
    color: #7f8c8d;
    font-weight: 700;
}

.split-view .counter-box .timer {
    font-size: 3vh;
    margin: 0;
    color: #2980b9;
    font-weight: 800;
}

.split-view .counter-box small {
    display: none;
}

.split-view .lunch-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff8e1;
    padding: 1.5vh;
    text-align: center;
    overflow: hidden;
}

.lunch-title {
    font-size: 2.2vh;
    font-weight: 800;
    color: #d35400;
    border-bottom: 2px dashed #f39c12;
    padding-bottom: 1vh;
    margin-bottom: 1.5vh;
    text-transform: uppercase;
}

.lunch-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.2vh;
    font-size: 2.4vh;
    font-weight: 600;
    color: #2c3e50;
    overflow-y: auto;
}

.lunch-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lunch-item::before {
    content: '•';
    color: #e67e22;
    margin-right: 0.5vw;
    font-size: 1.2em;
}


/* --- TAM EKRAN MODU (YEMEK YOKKEN / HAFTASONU) --- */
.full-view {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    height: 100%;
    padding: 2vh 0;
    text-align: center;
}

.full-view .counter-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.full-view .timer {
    font-size: 6vh;
    color: var(--accent-color);
    margin: 1vh 0;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.full-view h3 {
    font-size: 3vh;
    margin-bottom: 0.5vh;
    font-weight: 700;
    color: #2c3e50;
}

.full-view small {
    font-size: 2.2vh;
    color: #7f8c8d;
    display: block;
    margin-top: 0.5vh;
    font-weight: 600;
}

/* ----------------------------------------------- */

/* VIDEO */
.video-container {
    flex: 1;
    position: relative;
    border-radius: 2vh;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 3vh rgba(0, 0, 0, 0.6);
}

#main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* SAAT */
.overlay-clock {
    position: absolute;
    top: 3vh;
    right: 3vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    padding: 2vh 4vh;
    border-radius: 2vh;
    color: white;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.3);
}

#clock-time {
    font-size: 9vh;
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.2vh;
}

#clock-date {
    font-size: 2.2vh;
    opacity: 0.95;
    margin-top: 1vh;
    font-weight: 600;
}

/* ORTA KART */
.lesson-status-card {
    height: 16vh;
    background: #fff;
    border-radius: 2vh;
    display: flex;
    align-items: center;
    padding: 0 3vh;
    box-shadow: 0 0.5vh 2vh rgba(0, 0, 0, 0.15);
    border-left: 1.5vh solid #95a5a6;
    transition: all 0.5s ease;
    justify-content: space-between;
}

.status-icon {
    font-size: 5vh;
    color: #34495e;
    margin-right: 2vw;
    width: 5vw;
    text-align: center;
}

.status-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.status-title {
    font-size: 3.2vh;
    font-weight: 800;
    color: #2c3e50;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 0.5vh;
}

.status-sub {
    font-size: 1.8vh;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 2.5vh;
}

.status-time {
    font-size: 6.5vh;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    background: #f1f2f6;
    padding: 0.5vh 3vh;
    border-radius: 1.5vh;
    letter-spacing: -0.3vh;
}

.status-break {
    border-left-color: #2ecc71 !important;
    background: #eafff0 !important;
}

.status-break .status-title,
.status-break .status-time,
.status-break .status-icon {
    color: #27ae60;
}

.status-break .status-time {
    background: #dbece0;
}

.status-lesson {
    border-left-color: #e74c3c !important;
    background: #fff5f5 !important;
}

.status-lesson .status-title,
.status-lesson .status-time,
.status-lesson .status-icon {
    color: #c0392b;
}

.status-lesson .status-time {
    background: #fadbd8;
}

/* NÖBETÇİ LİSTESİ */
.duty-item {
    background: #fff;
    flex: 1;
    padding: 0 1.2vw;
    border-radius: 1.2vh;
    display: flex;
    align-items: center;
    gap: 0.8vw;
    box-shadow: 0 0.2vh 0.4vh rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f2f6;
    border-left: 0.8vh solid #3498db;
    margin-bottom: 0;
    min-height: 0;
}

.duty-avatar {
    height: 5.5vh;
    width: 5.5vh;
    font-size: 2vh;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 0.5vh 1vh rgba(0, 0, 0, 0.15);
}

.duty-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.duty-name {
    font-size: clamp(12px, 2vh, 24px);
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.1vh;
    white-space: normal;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.duty-loc {
    background-color: #f1f2f6;
    color: #576574;
    font-size: clamp(9px, 1.4vh, 18px);
    font-weight: 800;
    padding: 0.6vh 1vh;
    border-radius: 2vh;
    text-align: center;
    line-height: 1.1;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-width: 25%;
}

.lunch-badge {
    font-size: 1.2vh;
    padding: 0.3vh 0.8vh;
    margin-top: 0.3vh;
    align-self: flex-start;
}

/* HABERLER */
.news-widget {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
    overflow: hidden;
}

.news-header {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    padding: 1.2vh;
    font-weight: 700;
    font-size: 1.8vh;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
    gap: 1vh;
}

.news-list {
    list-style: none;
    padding: 1.2vh;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8vh;
}

.news-item {
    background: #fff;
    padding: 1.2vh;
    border-radius: 1vh;
    border-left: 0.6vh solid var(--accent-color);
    box-shadow: var(--shadow-soft);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-item h4 {
    font-size: 1.6vh;
    margin-bottom: 0.4vh;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item div {
    font-size: 1.4vh;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* DERS PROGRAMI */
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 1vh;
}

.schedule-table th:nth-child(1) {
    width: 35%;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #e9ecef;
    color: #2c3e50;
    text-align: left;
    padding: 1.5vh;
    box-shadow: 0 0.2vh 0.5vh rgba(0, 0, 0, 0.05);
    border-radius: 0.8vh;
    font-size: 2.2vh;
}

.schedule-table th:nth-child(2) {
    width: 65%;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #e9ecef;
    color: #2c3e50;
    text-align: left;
    padding: 1.5vh;
    box-shadow: 0 0.2vh 0.5vh rgba(0, 0, 0, 0.05);
    border-radius: 0.8vh;
    font-size: 2.2vh;
}

.schedule-table td {
    vertical-align: middle;
    padding: 1vh 1.5vh;
    background: #fff;
    border-radius: 0.6vh;
    box-shadow: 0 0.1vh 0.3vh rgba(0, 0, 0, 0.03);
    color: #555;
    font-weight: 600;
}

.cell-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.status-label {
    font-size: 1.4vh;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5vh;
    display: flex;
    align-items: center;
    gap: 0.5vh;
}

.status-label.next {
    color: #e67e22;
}

.status-label.current {
    color: #27ae60;
}

.status-label.info {
    color: #95a5a6;
}

.lesson-text {
    font-size: 2.2vh;
    line-height: 1.2;
    color: #2c3e50;
    white-space: normal;
    overflow: visible;
}

/* İMZA */
.creator-sign {
    position: fixed;
    top: 2vh;
    right: 2vw;
    bottom: auto;
    color: #fff !important;
    font-size: 1.5vh;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 0.8vh 1.5vw;
    border-radius: 5vh;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2000;
    pointer-events: none;
    animation: slideFadeLoop 10s infinite ease-in-out;
}

@keyframes slideFadeLoop {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }

    10% {
        opacity: 1;
        transform: translateX(0);
    }

    80% {
        opacity: 1;
        transform: translateX(0);
    }

    90% {
        opacity: 0;
        transform: translateX(-10px);
    }

    100% {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* KART KONTROLLERİ */
.card {
    cursor: pointer;
    border-radius: 2vh !important;
}

.card.paused {
    box-shadow: 0 0 2vh rgba(52, 152, 219, 0.6) !important;
    border: 0.4vh solid rgba(52, 152, 219, 0.5) !important;
}

.card.paused .card-face::after {
    content: 'SABİTLENDİ';
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 900;
    position: absolute;
    top: 1vh;
    right: 1vh;
    background-color: #e74c3c;
    color: #ffffff;
    padding: 1vh 2vh;
    border-radius: 1vh;
    font-size: 1.5vh;
    letter-spacing: 0.1vh;
    text-transform: uppercase;
    box-shadow: 0 0.5vh 1vh rgba(0, 0, 0, 0.3);
    z-index: 2000;
    pointer-events: none;
    animation: kalpAtisi 2s infinite ease-in-out;
}

@keyframes kalpAtisi {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.flip-control {
    position: absolute;
    bottom: 0.5vh;
    right: 0.5vh;
    width: 4vh;
    height: 4vh;
    background: rgba(255, 255, 255, 0.6);
    color: #34495e;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8vh;
    cursor: pointer;
    box-shadow: 0 0.2vh 0.5vh rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(236, 240, 241, 0.5);
    z-index: 50;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.flip-control:hover,
.flip-control:active {
    background: #3498db;
    color: white;
    opacity: 1;
    transform: rotate(180deg) scale(1.1);
    border-color: #3498db;
    box-shadow: 0 0.5vh 1.5vh rgba(52, 152, 219, 0.4);
}

/* SCROLL */
#duty-list-container {
    overflow: hidden !important;
}

#schedule-container {
    overflow-y: auto !important;
    scroll-behavior: smooth;
    padding-bottom: 25px;
}

#schedule-container::-webkit-scrollbar {
    width: 6px;
}

#schedule-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

#schedule-container::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.scroll-indicator-icon {
    position: absolute;
    bottom: 10px;
    right: 45%;
    transform: translateX(50%);
    font-size: 24px;
    color: #e74c3c;
    z-index: 99;
    animation: bounce 1.5s infinite;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* --- YENİ EKLENEN: MOBİL ENGELLEME --- */
#mobile-warning {
    display: none;
}

@media only screen and (max-width: 767px) {

    /* Ana içerikleri gizle */
    .school-header,
    .creator-sign,
    .dashboard-grid {
        display: none !important;
    }

    /* Arka planı düzelt */
    body {
        background: #1a1a2e;
        overflow: hidden;
    }

    /* Uyarı kutusunu göster ve şekillendir */
    #mobile-warning {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        color: white;
        text-align: center;
        padding: 20px;
        z-index: 9999;
    }

    #mobile-warning i {
        font-size: 4rem;
        margin-bottom: 20px;
        color: #e74c3c;
    }

    #mobile-warning h2 {
        margin-bottom: 15px;
        font-size: 1.5rem;
    }

    #mobile-warning p {
        font-size: 1rem;
        color: #bdc3c7;
        line-height: 1.5;
        max-width: 80%;
    }
}

/* --- MODERN SINAV KARTLARI --- */

/* LİSTE KAPSAYICISI */
.dynamic-exam-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 1vh;
    gap: 1vh;
    box-sizing: border-box;
}

/* 4 VE DAHA FAZLA SINAV İÇİN GRID MODU */
.dynamic-exam-list.layout-grid {
    flex-direction: row;
    flex-wrap: wrap;
}

/* KART YAPISI */
.exam-card-modern {
    background: #ffffff;
    border-radius: 8px;
    border: none;
    border-left: 6px solid #3498db;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);

    /* ESNEKLİK AYARLARI */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Varsayılan (3 sınav): Tam genişlik */
    width: 100%;
    flex: 1;

    padding: var(--dynamic-pad, 0.5vh);
    transition: transform 0.2s;
    box-sizing: border-box;
}

/* GRID MODUNDA KARTLARIN DAVRANIŞI */
.layout-grid .exam-card-modern {
    width: 48%;
    flex: 1 0 40%;
}

/* Renkli Çizgiler */
.exam-card-modern:nth-child(1) {
    border-left-color: #e74c3c;
}

/* Kırmızı */
.exam-card-modern:nth-child(2) {
    border-left-color: #f39c12;
}

/* Turuncu */
.exam-card-modern:nth-child(3) {
    border-left-color: #27ae60;
}

/* Yeşil */
.exam-card-modern:nth-child(4) {
    border-left-color: #9b59b6;
}

/* Mor */
.exam-card-modern:nth-child(5) {
    border-left-color: #34495e;
}

/* Gri */

.exam-timer-modern {
    font-family: 'Segoe UI', sans-serif;
    color: #2c3e50;
    font-weight: 800;
    line-height: 1;
    margin: 0.2vh 0;
    letter-spacing: -1px;
    font-size: var(--dynamic-timer, 4vh);
}

/* Tamamlanan sınavlar için stil */
.exam-timer-modern.finished {
    font-size: calc(var(--dynamic-timer) * 0.5) !important;
    color: #fff !important;
    background: #27ae60;
    display: inline-block;
    padding: 0.2vh 1.5vh;
    border-radius: 50px;
    align-self: center;
    font-weight: 600;
    margin-top: 0.8vh;
    margin-bottom: 0.8vh;
}

.exam-title-modern {
    color: #7f8c8d;
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--dynamic-title, 2vh);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exam-date-modern {
    color: #95a5a6;
    font-weight: 600;
    font-size: var(--dynamic-date, 1.5vh);
    margin-top: 1vh;
}