/* -------------------------------------------------------------------------- */
/* ALFAWEB.TR - STYLE SHEET v2.14 (CLS 0 | A11y 100 | Perf 100)              */
/* -------------------------------------------------------------------------- */

:root {
    /* --- Light Mode --- */
    --bg-body: #ffffff;
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.95);

    --text-main: #020617; 
    --text-muted: #334155; /* AAA Uyumlu Kontrast (9.0:1) */
    --text-light: #475569;

    --primary: #1d4ed8; 
    --primary-hover: #1e40af; 
    --primary-light: rgba(29, 78, 216, 0.1);

    --border: #e2e8f0;
    --ring: rgba(29, 78, 216, 0.25);

    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --font-main: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
    /* --- Dark Mode --- */
    --bg-body: #020617;
    --bg-surface: #0f172a;
    --bg-card: #1e293b;
    --bg-glass: rgba(2, 6, 23, 0.90);

    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;

    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);

    --border: #1e293b;
    --ring: rgba(59, 130, 246, 0.3);

    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* 2. RESET & TEMEL */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex; flex-direction: column; min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    
    /* CLS DÜZELTMESİ (ÖNEMLİ): Scrollbar payını rezerve et */
    scrollbar-gutter: stable; 
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
img, svg { display: block; }
button, input { font-family: inherit; }

/* H1 API UYARISI DÜZELTMESİ */
h1 { font-size: 2em; margin: 0.67em 0; } 

/* LAYOUT */
.container { 
    width: 100%; 
    max-width: 100%; 
    margin: 0 auto; 
    padding: 0 50px; 
}

/* 3. HEADER & NAVİGASYON */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background-color: var(--bg-glass);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}
.header-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
.logo svg { color: var(--primary); transition: transform 0.3s; }
.logo:hover svg { transform: rotate(-15deg) scale(1.1); }
.logo span { color: var(--primary); }

.nav-menu { display: flex; gap: 32px; }
.nav-link { font-weight: 500; color: var(--text-muted); position: relative; padding: 6px 0; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary); transition: 0.3s; }
.nav-link:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }

/* 4. UI BİLEŞENLERİ */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    padding: 10px 20px; 
    font-weight: 600; 
    border-radius: var(--radius-md); 
    transition: 0.2s; 
    border: 1px solid transparent; 
    cursor: pointer; 
    font-size: 0.9rem;
    white-space: nowrap; 
    flex-shrink: 0; 
}

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text-main); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-surface); }

.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--text-main); transition: 0.2s; }
.theme-btn:hover { background: var(--border); transform: rotate(15deg); }

.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.form-input { width: 100%; padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-main); outline: none; transition: 0.2s; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); background: var(--bg-card); }

::placeholder { color: #64748b; opacity: 1; }

/* 5. HERO SECTION */
.hero-section { padding: 100px 0 80px; text-align: center; }
.hero-title { 
    font-size: clamp(2.5rem, 6vw, 4rem); 
    font-weight: 800; 
    line-height: 1.1; 
    margin-bottom: 25px;
    will-change: transform, opacity; 
    
    /* API Uyarısı için açık font boyutu */
    font-size: clamp(2.5rem, 6vw, 4rem);
}
.text-gradient { background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 1.25rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 35px; }

/* 6. PROJE KARTLARI */
.project-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 30px; 
    padding-bottom: 80px; 
}

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; display: flex; flex-direction: column; transition: 0.3s; position: relative; overflow: hidden; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--primary), #a855f7); opacity: 0; transition: 0.3s; }
.card:hover::before { opacity: 1; }

/* BADGE RENKLERİ */
.card-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 15px; width: fit-content; }

.badge-php { background: rgba(37, 99, 235, 0.1); color: #172554; } 
.badge-cpp { background: rgba(220, 38, 38, 0.1); color: #7f1d1d; } 
.badge-csharp { background: rgba(22, 163, 74, 0.1); color: #14532d; } 

[data-theme="dark"] .badge-php { background: rgba(59, 130, 246, 0.2); color: #dbeafe; }
[data-theme="dark"] .badge-cpp { background: rgba(239, 68, 68, 0.2); color: #fee2e2; }
[data-theme="dark"] .badge-csharp { background: rgba(34, 197, 94, 0.2); color: #dcfce7; }

.card h3 { font-size: 1.5rem; margin-bottom: 10px; color: var(--text-main); }
.card p { color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; font-size: 1rem; }
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 20px; margin-top: auto; }
.price { display: flex; flex-direction: column; }
.price-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.price-val { font-size: 1.3rem; font-weight: 800; }

/* 7. AUTH MODAL (CLS DÜZELTMESİ) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    
    /* CLS İÇİN KRİTİK: Varsayılan olarak layout ağacından çıkar */
    display: none; 
    opacity: 0; 
    transition: opacity 0.3s ease;
}

/* JS ile .active sınıfı eklendiğinde görünür olur */
.modal-overlay.active { 
    display: flex; /* Layout'a geri döner */
    opacity: 1; 
    visibility: visible; 
}

.modal-content {
    background: var(--bg-card); width: 100%; max-width: 420px; padding: 35px;
    border-radius: var(--radius-xl); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); 
    
    /* CLS İÇİN: Animasyon sadece active durumunda */
    transform: translateY(0); 
}
.modal-overlay.active .modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.close-modal { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 1.8rem; color: var(--text-muted); cursor: pointer; line-height: 1; transition: 0.2s; }
.close-modal:hover { color: var(--primary); transform: rotate(90deg); }

.auth-view { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 8. FOOTER */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-surface); padding: 50px 0 30px; margin-top: auto; }

/* 9. RESPONSIVE & MOBILE APP NAVIGATION */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    .container { padding: 0 20px; width: 100%; }
    .hero-title { font-size: 2.2rem; }
    
    .header-inner { 
        padding: 0 20px; 
        height: 72px; 
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .project-grid { grid-template-columns: 1fr; }

    .nav-menu { display: none !important; }
    .header-actions .btn { display: none !important; } 
    .header-actions .theme-btn { display: flex !important; margin-left: auto; width: 42px; height: 42px; }

    body { padding-bottom: 80px; }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: var(--bg-glass);
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 0 10px;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        font-size: 0.8rem;
        font-weight: 600;
        gap: 4px;
        width: 100%;
        height: 100%;
    }

    .mobile-nav-item svg { width: 24px; height: 24px; }
    
    .mobile-nav-item.active, 
    .mobile-nav-item:hover {
        color: var(--primary);
    }
    .mobile-nav-item.active svg {
        fill: rgba(29, 78, 216, 0.1);
    }
}

/* 10. PERFORMANS OPTİMİZASYONLARI */
svg { width: 100%; height: 100%; max-width: 24px; max-height: 24px; }
.logo svg { max-width: 28px; max-height: 28px; }
.license-icon svg, .license-icon { max-width: none; max-height: none; } 

.site-footer, .project-grid, #projects {
    content-visibility: auto; 
    contain-intrinsic-size: 1px 1000px;
}