/* Ortak header ve footer stilleri - index.php ile birebir aynı */
:root {
    --coe-blue: #003366;
    --coe-blue-light: #004494;
    --coe-gold: #c4a747;
    --header-height: 72px;
    --footer-height: 44px;
}

.site-header {
    background: var(--coe-blue);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    width: 100%;
    align-self: stretch;
    flex-shrink: 0;
    box-shadow: inset 0 -3px 0 var(--coe-gold);
}
.site-header .header-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.site-header .header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-header .coe-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    cursor: default;
    flex-shrink: 0;
}
.site-header .coe-logo:hover { color: white; opacity: 1; }
.site-header .coe-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--coe-gold);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--coe-blue);
}
.site-header .coe-logo-text { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.site-header .coe-logo img { height: 44px; max-width: 280px; object-fit: contain; }
.site-header .header-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.site-header .header-page-title {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
    color: #fff;
}
.site-header .header-exam-meta {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(420px, 46vw);
}
.site-header .lang-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    width: max-content;
    max-width: none;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    overflow: hidden;
}
.site-header .lang-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 5px 9px;
    background: transparent;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    appearance: none;
    border-radius: 0;
    text-decoration: none;
}
.site-header .lang-btn:last-child { border-right: 0; }
.site-header .lang-btn:hover, .site-header .lang-btn.active {
    background: var(--coe-gold);
    color: var(--coe-blue);
}
.site-header .header-btn {
    padding: 10px 24px;
    background: var(--coe-gold);
    color: var(--coe-blue);
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}
.site-header .header-btn:hover {
    background: #d4b84d;
    transform: translateY(-1px);
}
.site-header .header-back {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 14px;
}
.site-header .header-back:hover { text-decoration: underline; }

.site-header .header-admin {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.site-header .header-session-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.site-header .header-session-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    max-width: min(320px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-header .header-admin-link {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.site-header .header-admin-link:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}
.site-header .header-admin-menu {
    position: relative;
}
.site-header .header-admin-trigger {
    list-style: none;
    cursor: pointer;
    padding: 8px 14px;
    background: rgba(196, 167, 71, 0.22);
    border: 1px solid rgba(196, 167, 71, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    user-select: none;
}
.site-header .header-admin-trigger::-webkit-details-marker { display: none; }
.site-header .header-admin-trigger:hover {
    background: rgba(196, 167, 71, 0.32);
}
.site-header .header-admin-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    width: min(300px, calc(100vw - 32px));
    padding: 14px 16px;
    background: #fff;
    color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 51, 102, 0.12);
}
.site-header .header-admin-hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: #5c6b7a;
    line-height: 1.45;
}
.site-header .header-admin-error {
    margin: 0 0 10px;
    font-size: 13px;
    color: #b00020;
}
.site-header .header-admin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.site-header .header-admin-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}
.site-header .header-admin-submit {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px;
    border: 1px solid #003366;
    background: #003366;
    color: #fff;
    cursor: pointer;
}
.site-header .header-admin-submit:hover {
    background: #004494;
}

.site-footer {
    background: var(--coe-blue);
    color: rgba(255,255,255,0.9);
    text-align: center;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 13px;
    width: 100%;
    align-self: stretch;
    flex-shrink: 0;
    margin-top: auto;
    box-shadow: inset 0 3px 0 var(--coe-gold);
    z-index: 200;
}

/* Sayfa düzeni: header + içerik + footer */
body.page-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header ve footer sabit - sayfa kayarken sabit kalır, sadece içerik kayar */
body.has-header-footer .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
}

body.has-header-footer .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: var(--footer-height);
    z-index: 100;
}

/* İçerik header/footer altında kalmaması için boşluk */
body.has-header-footer {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}

body.has-header-footer .content {
    flex: 1;
}

/* Sidebar sayfalarında header varsa sidebar'ı header altına al */
body.has-header-footer .sidebar {
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

/* Görev açıklaması (admin / hakem): tablo ve paragraflar — global table td padding ile çakışmayı önler */
.gorev-aciklama-empty {
    color: #9ca3af;
    font-size: 14px;
}
.gorev-aciklama-plain {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}
.gorev-aciklama-plain strong,
.gorev-aciklama-rich strong,
.gorev-aciklama-rich b {
    font-weight: 600;
    color: #1f2937;
}
.gorev-align-center {
    text-align: center !important;
    display: block;
    margin: 0.5em 0;
    width: 100%;
    box-sizing: border-box;
}
.gorev-aciklama-rich {
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}
.gorev-aciklama-rich table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0.35em 0;
}
.gorev-aciklama-rich td,
.gorev-aciklama-rich th {
    padding: 4px 8px !important;
    line-height: 1.35 !important;
    vertical-align: top;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.gorev-aciklama-rich p {
    margin: 0.35em 0;
}
.gorev-aciklama-rich p:first-child {
    margin-top: 0;
}
@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    body.has-header-footer {
        padding-top: 0;
    }

    body.has-header-footer .site-header {
        position: sticky;
        top: 0;
        height: auto;
        min-height: 56px;
        padding: 8px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .site-header .header-left {
        flex: 1 1 100%;
        min-width: 0;
        gap: 8px;
        width: 100%;
    }

    .site-header .header-right {
        width: 100%;
        justify-content: space-between;
        flex-shrink: 0;
        gap: 6px;
    }

    .site-header .coe-logo-text {
        display: none;
    }

    .site-header .coe-logo img {
        display: none;
    }

    .site-header .coe-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .site-header .header-context {
        padding-left: 10px;
    }

    .site-header .header-page-title {
        font-size: 13px;
    }

    .site-header .header-exam-meta {
        font-size: 11px;
        max-width: min(200px, 42vw);
    }

    .site-header .header-session-name {
        display: none;
    }

    .site-header .header-admin-logout {
        padding: 6px 10px;
        font-size: 12px;
    }

    .site-header .lang-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}
