/* ==========================================================================
   RESET & ULTRA MODERN SAAS DEĞİŞKENLERİ
   ========================================================================== */
:root {
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --primary-dark: #1d4ed8;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 25px var(--primary-glow);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.85rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --primary-dark: #0284c7;
    --accent-purple: #a855f7;
    --accent-cyan: #22d3ee;
    
    --background: #090d16;
    --surface: #111827;
    --surface-hover: #1f293d;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1f293d;
    --border-hover: #38bdf8;
    
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 25px 30px -5px rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    padding-bottom: 70px;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 60%, rgba(139, 92, 246, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
}

body.no-scroll { overflow: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button, input, select { font-family: inherit; }

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
header {
    background-color: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: var(--transition-smooth);
}

:root:not([data-theme="dark"]) header {
    background-color: rgba(255, 255, 255, 0.85);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.desktop-nav {
    display: none;
    gap: 2rem;
    align-items: center;
    font-weight: 600;
}

.desktop-nav a {
    color: var(--text-muted);
    transition: var(--transition-smooth);
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
}

.desktop-nav a:hover {
    color: var(--primary);
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s ease;
    border-radius: 2px;
}

.desktop-nav a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.theme-toggle, .mobile-menu-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text);
    padding: 0.55rem;
    font-size: 1.15rem;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover, .mobile-menu-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    display: none;
    padding: 0.55rem 1.25rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.btn-outline:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
}

/* ==========================================================================
   MOBILE DRAWER MENÜ
   ========================================================================== */
.mobile-menu-btn { display: block; }

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 340px;
    height: 100%;
    background: var(--surface);
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-drawer.active { right: 0; }

.drawer-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0 2rem;
}

.drawer-category {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.25rem 1.5rem 0.5rem;
}

.drawer-nav a {
    padding: 0.75rem 1.5rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: var(--transition-smooth);
}

.drawer-nav a:hover {
    background: rgba(56, 189, 248, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ==========================================================================
   HERO & HIZLI ERİŞİM
   ========================================================================== */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1rem 1.5rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    color: var(--text);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, #38bdf8 50%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2rem;
    font-weight: 450;
}

.quick-access {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.quick-btn {
    padding: 0.65rem 1.15rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.quick-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.quick-btn.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.quick-btn.highlight:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* ==========================================================================
   SINAV SAYAÇLARI
   ========================================================================== */
.exam-timers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
    max-width: 1200px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
}

.timer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.timer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent-purple));
    opacity: 0.8;
}

.timer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(56, 189, 248, 0.4);
}

.timer-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.timer-select {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    outline: none;
    width: 100%;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.timer-select:focus { border-color: var(--primary); }

.timer-digits {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
}

.digit-box {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.2rem;
    transition: var(--transition-smooth);
}

.timer-card:hover .digit-box {
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.03);
}

.digit-val {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.digit-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   KATEGORİLER & HESAPLAMA ARAÇ KARTLARI
   ========================================================================== */
.category-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.category-title {
    font-size: 1.55rem;
    font-weight: 900;
    margin-bottom: 1.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.5px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 1.35rem;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.65rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    background: var(--surface-hover);
}

.tool-icon {
    font-size: 1.75rem;
    margin-bottom: 1.15rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(139, 92, 246, 0.15));
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: var(--transition-smooth);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(4deg);
    box-shadow: 0 0 15px var(--primary-glow);
}

.tool-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.3px;
}

.tool-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 1.35rem;
    line-height: 1.5;
}

.tool-link {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
}

.tool-link::after { content: "→"; transition: transform 0.2s ease; }
.tool-card:hover .tool-link::after { transform: translateX(5px); }

/* ==========================================================================
   HESAPLAMA SAYFALARI FORM & TABLO YAPISI (ALT SAYFALAR İÇİN)
   ========================================================================== */
.calc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto 3rem;
    width: 100%;
}

.input-row { display: flex; gap: 1rem; }
.input-group { margin-bottom: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.input-group label { font-weight: 600; margin-bottom: 0.5rem; color: var(--text); font-size: 0.95rem; }

.input-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-group input.error {
    border-color: var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}

.error-text { color: var(--danger); font-size: 0.85rem; margin-top: 0.35rem; display: none; }

.calc-submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.calc-submit-btn:hover { background: var(--primary-dark); }

/* SONUÇ KUTUSU */
.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    display: none;
}

.result-box.active { display: block; }
.result-title { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; font-weight: 700; opacity: 0.8; }
.result-val { font-size: 2.75rem; font-weight: 800; margin-bottom: 0.5rem; line-height: 1; }
.result-msg { font-size: 1.1rem; font-weight: 600; }

.result-success {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--success);
    color: #15803d;
}

.result-error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: #b91c1c;
}

[data-theme="dark"] .result-success { color: var(--success); }
[data-theme="dark"] .result-error { color: var(--danger); }

/* DİNAMİK DERS TABLOSU */
.calc-table-wrapper { overflow-x: auto; margin-bottom: 1.25rem; }
.calc-table { width: 100%; border-collapse: collapse; min-width: 350px; }
.calc-table th {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.calc-table td { padding: 0.5rem; border-bottom: 1px solid var(--border); }
.calc-table input, .calc-table select {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}
.calc-table input:focus, .calc-table select:focus { border-color: var(--primary); }

.btn-secondary {
    background: var(--background);
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-bottom: 1.5rem;
}
.btn-secondary:hover { background: rgba(59, 130, 246, 0.08); }

/* SONUÇ KARTI PAYLAŞIM ALTYAPISI */
.share-action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s;
}
.btn-share:active { transform: scale(0.98); }
.btn-whatsapp { background-color: #25d366; color: #ffffff; }
.btn-whatsapp:hover { opacity: 0.9; }
.btn-download-card { background-color: #2563eb; color: #ffffff; }
.btn-download-card:hover { background-color: #1d4ed8; }

.shareable-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff !important;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}
.shareable-card .card-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.6rem;
    margin-bottom: 0.85rem;
}
.shareable-card .card-brand span { font-weight: 700; font-size: 1.1rem; color: #38bdf8; }
.shareable-card .card-brand small { font-size: 0.75rem; color: #94a3b8; }
.shareable-card .card-body { text-align: center; padding: 0.5rem 0; }
.shareable-card .card-body .primary-val { font-size: 2.25rem; font-weight: 800; color: #f8fafc; margin-bottom: 0.25rem; }
.shareable-card .card-body .status-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.shareable-card .card-footer { margin-top: 0.85rem; text-align: center; font-size: 0.75rem; color: #64748b; }

/* ==========================================================================
   İÇERİK BİLGİ ALANI & REKLAMLAR
   ========================================================================== */
.breadcrumb { margin-bottom: 1.5rem; color: var(--text-muted); font-size: 0.875rem; }
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

.content-section {
    margin-bottom: 2.5rem;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.content-section h2 { font-size: 1.35rem; margin-bottom: 1rem; color: var(--primary); }
.content-section p { margin-bottom: 0.75rem; color: var(--text); }

.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 2.5rem 0;
    padding: 0 1rem;
}
.ad-space {
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: var(--radius-md);
    border: 2px dashed var(--danger);
    width: 100%;
    max-width: 970px;
    height: 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.ad-space::after { content: "REKLAM ALANI"; opacity: 0.4; }

.sticky-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    z-index: 80;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sticky-ad .ad-space { margin: 0; max-width: 728px; height: 50px; border-color: var(--warning); border-style: solid; }
.close-sticky-ad {
    position: absolute;
    top: -26px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 3px 12px;
    border-radius: 8px 8px 0 0;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 800;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3.5rem 1rem 5.5rem;
    text-align: center;
    margin-top: 2rem;
}
.footer-logo {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    display: inline-block;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 0.9rem;
}
.footer-links a { color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
.copyright { color: var(--text-muted); font-size: 0.85rem; }

/* Responsive */
@media (max-width: 650px) {
    .hero h1 { font-size: 2.1rem; }
    .tool-grid { grid-template-columns: 1fr; }
    .exam-timers-grid { grid-template-columns: 1fr; }
    .ad-space { height: 250px; }
    .sticky-ad .ad-space { height: 50px; }
    .input-row { flex-direction: column; gap: 0; }
    .share-action-group { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
    .desktop-nav { display: flex; }
    .btn-outline { display: inline-block; }
    .mobile-menu-btn { display: none; }
    .hero h1 { font-size: 3.25rem; }
}