/* ==========================================================================
   DersTeders - Marka Katmani (brand.css)
   --------------------------------------------------------------------------
   Tum sayfalarda en son yuklenir ve mevcut tasarimlarin uzerine ince bir
   "marka cilasi" ekler:
     1) Giris / Kayit butonlari (tam yeniden tasarim)
     2) Tipografi (serif basliklar + okunabilir govde)
     3) Renk uyumu (petrol ana, altin vurgu, turuncu sadece CTA)
     4) Kart / whitespace / mikro-detay iyilestirmeleri
     5) Erisilebilirlik (WCAG AA kontrast, focus, dokunma alani)
   HTML yapisina dokunulmaz; sadece katmanli stil.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0) Marka renk tokenleri
   -------------------------------------------------------------------------- */
:root {
    --brand-petrol: #0F6B7C;
    --brand-petrol-mid: #12879C;
    --brand-petrol-dark: #0A3D4A;
    --brand-gold: #C5923E;
    --brand-gold-bright: #F5C542;
    --brand-orange: #E8783F;
    --brand-cream: #FBF9F4;
    --brand-dark-bg: #0B1B20;

    /* Buton renkleri (acik tema) */
    --brand-btn-outline: rgba(15, 107, 124, 0.45);
    --brand-btn-ink: var(--brand-petrol);
    --brand-btn-fill: var(--brand-petrol);
    --brand-btn-fill-hover: var(--brand-petrol-mid);

    --brand-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
    --brand-btn-outline: rgba(94, 203, 222, 0.5);
    --brand-btn-ink: #6FD3E4;
    --brand-btn-fill: #12879C;
    --brand-btn-fill-hover: #2AA3B8;
}

/* ==========================================================================
   1) GIRIS / KAYIT BUTONLARI
   --------------------------------------------------------------------------
   index.html .......... #auth-buttons .btn-ghost / .btn-accent
   pages/*.html ........ .auth-buttons .btn-login / .btn-register
   ========================================================================== */

/* Ortak buton iskeleti */
#auth-buttons a,
#user-menu .btn-ghost,
#user-menu .btn-accent,
.auth-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 20px;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.25s var(--brand-ease),
                color 0.25s var(--brand-ease),
                border-color 0.25s var(--brand-ease),
                box-shadow 0.25s var(--brand-ease),
                transform 0.25s var(--brand-ease);
}

/* --- GIRIS YAP : zarif outline --- */
#auth-buttons .btn-login,
#auth-buttons .btn-ghost,
#user-menu .btn-ghost,
.auth-buttons .btn-login,
a.btn-login {
    background: transparent;
    color: var(--brand-btn-ink);
    border: 1.5px solid var(--brand-btn-outline);
}

#auth-buttons .btn-login:hover,
#auth-buttons .btn-ghost:hover,
#user-menu .btn-ghost:hover,
.auth-buttons .btn-login:hover,
a.btn-login:hover {
    background: var(--brand-btn-fill);
    border-color: var(--brand-btn-fill);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 107, 124, 0.28);
}

/* --- KAYIT OL : petrol -> turkuaz gradient --- */
#auth-buttons .btn-register,
#auth-buttons .btn-accent,
#user-menu .btn-accent,
.auth-buttons .btn-register,
a.btn-register {
    background: linear-gradient(135deg, #0F6B7C 0%, #12879C 100%);
    color: #FFFFFF;
    border: 1.5px solid rgba(245, 197, 66, 0.35);
    box-shadow: 0 2px 10px rgba(15, 107, 124, 0.22);
}

#auth-buttons .btn-register:hover,
#auth-buttons .btn-accent:hover,
#user-menu .btn-accent:hover,
.auth-buttons .btn-register:hover,
a.btn-register:hover {
    background: linear-gradient(135deg, #12879C 0%, #1BA0B4 100%);
    filter: brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 107, 124, 0.35);
}

/* Tiklama aninda geri bildirim */
#auth-buttons a:active,
.auth-buttons a:active,
a.btn-login:active,
a.btn-register:active {
    transform: translateY(0);
}

/* Erisilebilirlik: altin focus halkasi */
#auth-buttons a:focus-visible,
#user-menu .btn-ghost:focus-visible,
#user-menu .btn-accent:focus-visible,
.auth-buttons a:focus-visible,
a.btn-login:focus-visible,
a.btn-register:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

/* Mobilde minimum 44px dokunma alani */
@media (max-width: 640px) {
    #auth-buttons a,
    .auth-buttons a,
    a.btn-login,
    a.btn-register {
        min-height: 44px;
        padding: 12px 18px;
    }
}

/* ==========================================================================
   2) TIPOGRAFI
   ========================================================================== */
h1, h2, h3,
.hero-title,
.section-title,
.card-title,
.feature-title,
.page-title,
.footer-heading,
.sub-header h3 {
    font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: -0.015em;
}

.hero-title {
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

/* Bolum basligi altinda altin vurgu cizgisi */
.section-head .section-title,
.section-header .section-title {
    position: relative;
    padding-bottom: 16px;
}

.section-head .section-title::after,
.section-header .section-title::after {
    content: '';
    display: block;
    width: 56px;
    height: 3px;
    margin: 16px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-bright));
}

.section-tag {
    color: #8A6318;
    background: rgba(197, 146, 62, 0.14);
    border-color: rgba(197, 146, 62, 0.3);
}

[data-theme="dark"] .section-tag {
    color: #E7C778;
    background: rgba(197, 146, 62, 0.16);
}

/* ==========================================================================
   3) RENK UYUMU
   --------------------------------------------------------------------------
   css/style.css kullanan sayfalardaki eski yesil palet petrol + altin
   marka paletine cekilir. index.html etkilenmez (.navbar kullaniyor).
   ========================================================================== */
body:has(.header) {
    --accent: #0F6B7C;
    --accent-dark: #0A3D4A;
    --accent-light: #E3F1F4;
    --secondary: #C5923E;
    --secondary-light: #F7EDDB;
    --gradient-primary: linear-gradient(135deg, #0F6B7C 0%, #12879C 100%);
    --gradient-hero: linear-gradient(135deg, #0A3D4A 0%, #0F6B7C 100%);
}

[data-theme="dark"] body:has(.header) {
    --accent: #2AA3B8;
    --accent-dark: #6FD3E4;
    --accent-light: #0E2A33;
    --secondary: #D9A84A;
    --secondary-light: #2A1F0D;
    --gradient-primary: linear-gradient(135deg, #12879C 0%, #2AA3B8 100%);
    --gradient-hero: linear-gradient(135deg, #0A3D4A 0%, #0F6B7C 100%);
}

/* Koyu tema gecislerini yumusat */
body,
.header,
.navbar,
.course-card,
.feature-card,
.footer,
.section {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* ==========================================================================
   4) KARTLAR / BOSLUK / MIKRO-DETAY
   ========================================================================== */
.course-card {
    transition: transform 0.35s var(--brand-ease),
                box-shadow 0.35s var(--brand-ease),
                border-color 0.35s var(--brand-ease);
}

.course-card:hover {
    transform: translateY(-6px) rotate(-0.4deg);
    border-color: rgba(15, 107, 124, 0.35);
}

.course-card:hover .card-icon {
    transform: scale(1.08) rotate(2deg);
}

.feature-card {
    transition: transform 0.35s var(--brand-ease),
                box-shadow 0.35s var(--brand-ease),
                border-color 0.35s var(--brand-ease);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 107, 124, 0.28);
}

.section {
    padding: clamp(64px, 9vw, 108px) 0;
}

.section-head,
.section-header {
    margin-bottom: clamp(40px, 6vw, 64px);
}

/* Kartlara hafif farkli ritim: ikinci kolon biraz asagi kaysin */
@media (min-width: 900px) {
    .courses-grid > *:nth-child(3n + 2) {
        transform: translateY(14px);
    }
    .courses-grid > *:nth-child(3n + 2):hover {
        transform: translateY(8px) rotate(-0.4deg);
    }
}

/* Altin ince ayrac: footer ust cizgisi */
.footer {
    border-top: 1px solid var(--border);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-gold), transparent);
}

/* ==========================================================================
   5) ERISILEBILIRLIK / ORTAK
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

/* Turuncu SADECE CTA/dikkat icin kalsin */
.btn-premium,
.btn-upgrade {
    background: linear-gradient(135deg, #E8783F 0%, #C5923E 100%);
}

@media (prefers-reduced-motion: reduce) {
    #auth-buttons a,
    .auth-buttons a,
    a.btn-login,
    a.btn-register,
    .course-card,
    .feature-card {
        transition: none;
    }
    .course-card:hover,
    .feature-card:hover,
    #auth-buttons a:hover,
    .auth-buttons a:hover {
        transform: none;
    }
    .courses-grid > *:nth-child(3n + 2) {
        transform: none;
    }
}

/* ==========================================================================
   5B) NAV AVATARI (tüm sayfalarda ortak)
   ========================================================================== */
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    user-select: none;
}

.nav-avatar.has-image {
    border-color: rgba(15, 107, 124, 0.35);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 640px) {
    .nav-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }
}

/* ==========================================================================
   6) ÇEREZ ONAY BANNER'I (KVKK / GDPR)
   --------------------------------------------------------------------------
   js/cookies.js tarafından otomatik oluşturulur. Tüm sayfalarda görünür.
   ========================================================================== */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--surface, #FFFFFF);
    color: var(--ink, #12333D);
    border-top: 1px solid var(--border, #E7E0D2);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(120%);
    transition: transform 0.4s var(--brand-ease, ease);
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner p {
    flex: 1;
    min-width: 220px;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--ink-soft, #3D6672);
}

.cookie-banner a {
    color: var(--brand-petrol, #0F6B7C);
    text-decoration: underline;
}

.cookie-btns {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s var(--brand-ease, ease);
}

.cookie-btn.primary {
    background: linear-gradient(135deg, #0F6B7C 0%, #12879C 100%);
    color: #FFFFFF;
}

.cookie-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 107, 124, 0.3);
}

.cookie-btn.secondary {
    background: var(--surface-2, #F4F0E8);
    color: var(--ink-soft, #3D6672);
    border: 1px solid var(--border, #E7E0D2);
}

.cookie-btn.secondary:hover {
    border-color: var(--brand-petrol, #0F6B7C);
    color: var(--brand-petrol, #0F6B7C);
}

/* Koyu tema: cerez banner'i sabit koyu zemin uzerinde okunur yapar.
   Bazi sayfalarda --ink-soft/--ink degiskenleri tanimli olmadigindan
   fallback renkler koyu kaliyor ve metin kayboluyordu. */
[data-theme="dark"] .cookie-banner {
    background: #10262E;
    color: #E9F2F4;
    border-top-color: #1E4650;
}

[data-theme="dark"] .cookie-banner p {
    color: #9DB8C0;
}

[data-theme="dark"] .cookie-banner a {
    color: #5ECBDE;
}

[data-theme="dark"] .cookie-btn.secondary {
    background: #16313B;
    color: #C7DADF;
    border-color: #1E4650;
}

[data-theme="dark"] .cookie-btn.secondary:hover {
    border-color: #2FA3B8;
    color: #6FD3E4;
}

@media (max-width: 640px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
    }
    .cookie-banner p {
        font-size: 0.82rem;
    }
    .cookie-btns {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   7) REKLAM ALANLARI (Google AdSense)
   ========================================================================== */
.ad-container {
    margin: 24px auto;
    text-align: center;
    max-width: 728px;
}

.ad-container.ad-vertical {
    max-width: 300px;
}

.ad-placeholder {
    position: relative;
    padding: 26px 16px;
    background: var(--surface-2, #F4F0E8);
    border: 1px dashed var(--border, #E7E0D2);
    border-radius: 12px;
}

.ad-label {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted, #8AA0A8);
}

.ad-demo {
    padding: 18px 0;
    color: var(--muted, #8AA0A8);
    font-size: 0.85rem;
}