/* =========================================================
   RUBIK ACADEMY — ORTAK STİLLER (common.css)
   Tüm sayfalarda <head> içine şu şekilde eklenir:
   <link rel="stylesheet" href="/styles/common.css">

   Bu dosya şunları içerir:
   - Renk değişkenleri (açık / karanlık mod)
   - Genel sıfırlama
   - Navbar (logo, menü, dil seçici, karanlık mod butonu)
   - Karanlık mod override'ları
   - Scroll reveal animasyonu
   - Footer
   - Arka plan glow efekti (bg-glow)
   - Eğitim/İçerik sayfaları ortak bloğu (hero + seviye kartları)

   Sayfaya özel şeyler (case-grid, tablo, vb. gerçekten
   sayfaya özgü bileşenler) HER SAYFANIN KENDİ <style>
   bloğunda kalmaya devam eder.
========================================================= */

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

/* =========================================
   RENK DEĞİŞKENLERİ — AÇIK MOD (varsayılan)
========================================= */
:root {
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --text: #172033;
    --text-soft: #64748b;
    --border: #e2e8f0;
    --card-border: #dfebf5;
    --shadow: 0 15px 40px rgba(15, 23, 42, 0.07);
    --diagram-bg: #f1f5f9;

    /* Eğitim sayfaları (hero / seviye kartları) için */
    --hero-bg: linear-gradient(120deg, #e8f7ff, #c8eaff);
    --hero-border: #cce8fa;
    --btn-bg: #eef8ff;
    --btn-hover-bg: #dff2ff;
    --bottom-bg: linear-gradient(135deg, #edf8ff, #e6f4ff);
    --bottom-border: #d5eafa;
    --bottom-text: #18578c;
}

/* =========================================
   RENK DEĞİŞKENLERİ — KARANLIK MOD
========================================= */
html.dark-mode,
body.dark-mode {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-soft: #334155;
    --text: #f8fafc;
    --text-soft: #cbd5e1;
    --border: #334155;
    --card-border: #334155;
    --primary-light: #1e3a8a;
    --shadow: 0 15px 40px rgba(0, 0, 0, 0.30);
    --diagram-bg: #0f172a;

    /* Eğitim sayfaları (hero / seviye kartları) için */
    --hero-bg: linear-gradient(120deg, #1e293b, #0f172a);
    --hero-border: #334155;
    --btn-bg: #334155;
    --btn-hover-bg: #1e3a8a;
    --bottom-bg: #1e293b;
    --bottom-border: #334155;
    --bottom-text: #60a5fa;
}

/* =========================================
   GENEL SIFIRLAMA
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--text);
    overflow-x: hidden;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   ARKA PLAN IŞIK EFEKTİ (bg-glow)
   Kullanmak isteyen sayfa <div class="bg-glow"></div>
   ekler; eklemeyen sayfada zaten etkisi olmaz.
========================================= */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -999;
    pointer-events: none;
}

.bg-glow::before,
.bg-glow::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    animation: floatGlow 15s infinite alternate ease-in-out;
}

.bg-glow::before {
    background: #2563eb;
    top: -100px;
    left: -100px;
}

.bg-glow::after {
    background: #6366f1;
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

html.dark-mode .bg-glow::before,
html.dark-mode .bg-glow::after {
    opacity: 0.25;
}

@keyframes floatGlow {
    0% { transform: translate(0px, 0px) scale(1); }
    100% { transform: translate(150px, 200px) scale(1.25); }
}

/* =========================================
   NAVBAR
========================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 7%;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s, border-color 0.3s;
}

html.dark-mode .navbar,
body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.90);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}

.nav-logo-text {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-soft);
    transition: .25s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* =========================================
   KARANLIK MOD BUTONU
========================================= */
.dark-mode-btn {
    border: none;
    background: var(--surface-soft);
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s;
}

.dark-mode-btn:hover {
    transform: scale(1.08);
}

/* =========================================
   DİL SEÇİCİ
========================================= */
.lang-switcher {
    position: relative;
}

.lang-switch-btn {
    border: none;
    background: var(--surface-soft);
    color: var(--text);
    height: 42px;
    padding: 0 16px;
    border-radius: 21px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: .3s;
}

.lang-switch-btn:hover {
    transform: scale(1.06);
    background: var(--primary-light);
    color: var(--primary);
}

.lang-switch-btn .lang-globe {
    font-size: 15px;
    line-height: 1;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 168px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: .2s ease;
    z-index: 1100;
}

.lang-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    width: 100%;
}

.lang-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.lang-menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
}

.lang-menu-item .lang-check {
    margin-left: auto;
    font-size: 12px;
    opacity: 0;
}

.lang-menu-item.active .lang-check {
    opacity: 1;
}

@media(max-width: 500px) {
    .navbar {
        padding: 14px 5%;
    }
    .nav-logo-text {
        font-size: 15px;
    }
    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
    }
    .nav-right {
        gap: 6px;
    }
    .lang-switch-btn {
        padding: 0 10px;
        font-size: 12px;
    }
}

/* =========================================
   FOOTER
========================================= */
footer {
    padding: 35px;
    text-align: center;
    background: transparent;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 13px;
    transition: background-color 0.3s, border-color 0.3s;
}

/* =========================================
   SCROLL REVEAL ANİMASYONU
========================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: .7s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   EĞİTİM/İÇERİK SAYFALARI ORTAK BLOĞU
   (3x3, 2x2, 4x4 gibi "seviye kartlı" tüm eğitim sayfalarında kullanılır)
   ========================================================= */

.page {
    min-height: calc(100vh - 71px);
    padding: 45px 5% 80px;
    background: var(--background);
    transition: background-color 0.3s;
}

.nav-bar {
    max-width: 1250px;
    margin: 0 auto 25px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: all .25s ease;
}

.back-btn:hover {
    transform: translateX(-4px);
    border-color: #c0e0fc;
    background: var(--primary-light);
}

.hero {
    max-width: 1250px;
    min-height: 390px;
    margin: 0 auto 45px;
    border-radius: 34px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 55px 65px;
    background: var(--hero-bg);
    border: 1px solid var(--hero-border);
    box-shadow: var(--shadow);
    transition: background 0.3s, border-color 0.3s;
}

.hero::before {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    border: 70px solid rgba(255, 255, 255, .15);
    left: -180px;
    top: -180px;
}

.hero-text {
    position: relative;
    z-index: 3;
    max-width: 590px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 15px;
    border-radius: 50px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
}

.badge i {
    width: 7px;
    height: 7px;
    background: #168ee0;
    border-radius: 50%;
}

.hero h1 {
    font-size: clamp(42px, 5vw, 68px);
    line-height: .98;
    letter-spacing: -3px;
    font-weight: 950;
    margin-bottom: 18px;
    color: var(--text);
}

.hero h1 span { color: var(--primary); }

.hero p {
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.75;
    max-width: 560px;
}

.hero-cube {
    width: 300px;
    height: 300px;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    filter: drop-shadow(0 25px 22px rgba(0, 0, 0, .23));
    animation: floating 5s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

.section-title {
    max-width: 1250px;
    margin: 0 auto 25px;
}

.section-title small {
    display: block;
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.7px;
    margin-bottom: 8px;
}

.section-title h2 {
    font-size: 30px;
    letter-spacing: -1px;
    font-weight: 900;
    color: var(--text);
}

.section-title p {
    color: var(--text-soft);
    font-size: 13px;
    margin-top: 7px;
}

.methods {
    max-width: 1250px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 27px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background-color 0.3s;
    display: block;
}

.card:hover {
    transform: translateY(-8px);
    border-color: #c7e5fa;
    box-shadow: 0 25px 50px rgba(35, 108, 162, .14);
}

.card-visual {
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-visual::before {
    content: "";
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, .25);
    top: -140px;
    right: -90px;
}

.beginner { background: linear-gradient(135deg, #e2f5ff, #91d8ff); }
.middle { background: linear-gradient(135deg, #e9e4ff, #b7a5ff); }
.advanced { background: linear-gradient(135deg, #dffaf1, #73d8c3); }

.level {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 5;
    padding: 8px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #26374b;
}

.cube {
    width: 225px;
    height: 225px;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1);
    filter: drop-shadow(0 20px 18px rgba(16, 35, 53, .22));
}

.card:hover .cube {
    transform: scale(1.08) translateY(-7px) rotate(-2deg);
}

.card-info { padding: 25px 25px 27px; }

.card-info h3 {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.5px;
    margin-bottom: 9px;
    color: var(--text);
}

.card-info p {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.65;
    min-height: 64px;
    margin-bottom: 20px;
}

.button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 15px;
    border-radius: 13px;
    background: var(--btn-bg);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    transition: background .25s ease, padding .25s ease, color .25s ease;
}

.card:hover .button {
    background: var(--btn-hover-bg);
    padding-left: 19px;
}

.arrow { font-size: 18px; }

.bottom {
    max-width: 1250px;
    margin: 38px auto 0;
    padding: 32px;
    text-align: center;
    border-radius: 25px;
    background: var(--bottom-bg);
    border: 1px solid var(--bottom-border);
    transition: background-color 0.3s, border-color 0.3s;
}

.bottom h3 { color: var(--bottom-text); font-size: 21px; margin-bottom: 7px; }
.bottom p { color: var(--text-soft); font-size: 13px; }

@media(max-width: 1000px) {
    .hero { padding: 45px; }
    .hero-cube { width: 250px; height: 250px; }
    .methods { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 700px) {
    .page { padding: 25px 4% 55px; }
    .hero { min-height: auto; padding: 38px 25px 25px; flex-direction: column; text-align: center; border-radius: 27px; }
    .hero-text { max-width: 100%; }
    .hero h1 { font-size: 43px; }
    .hero p { font-size: 14px; }
    .hero-cube { width: 235px; height: 235px; margin-top: 15px; }
    .methods { grid-template-columns: 1fr; gap: 20px; }
    .card-visual { height: 320px; }
    .section-title h2 { font-size: 27px; }
}
