/* =========================================================
   NOTMATİK - Temel Stil ve Tema Sistemi
   ========================================================= */

:root {
    --primary-dark: #8a0303;
    --primary-light: #d90429;
    --accent-color: #ef233c;
    --accent-hover: #c9182e;
    --success-color: #1f8a4c;
    --fail-color: #d90429;
    --warn-color: #e07a00;
    --bg-color: #f4f5f8;
    --card-bg: #ffffff;
    --text-color: #121316;
    --light-text: #5c6370;
    --input-bg: #ffffff;
    --weight-bg: #fdf1f2;
    --table-header-bg: #fbe3e5;
    --border-color: rgba(18, 19, 22, 0.08);
    --dashed-border: rgba(239, 35, 60, 0.32);
    --border-radius: 16px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

body.dark-mode {
    --primary-dark: #9e0b16;
    --primary-light: #70040b;
    --accent-color: #ff3b4e;
    --accent-hover: #e02438;
    --success-color: #3dd598;
    --fail-color: #ff5c6c;
    --warn-color: #ff9f1c;
    --bg-color: #0b090a;
    --card-bg: #16181d;
    --text-color: #f4f6f8;
    --light-text: #a5aab5;
    --input-bg: #1f2229;
    --weight-bg: #261316;
    --table-header-bg: #36191e;
    --border-color: rgba(255, 255, 255, 0.08);
    --dashed-border: rgba(255, 59, 78, 0.35);
    --box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1.5;
}

a {
    color: inherit;
}

button, input, select {
    font-family: inherit;
}

/* =========================================================
   HEADER & NAVİGASYON
   ========================================================= */

.site-header {
    width: 100%;
    background: linear-gradient(135deg, #0b090a 0%, #520208 55%, #8a0303 100%);
    color: #ffffff;
    box-shadow: var(--box-shadow);
    position: relative;
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 20px 14px;
}

.header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #ffffff;
}

.brand-logo-img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}

.brand-text-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.brand-title {
    margin: 0;
    font-weight: 900;
    font-size: 1.75rem;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
}

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

.header-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.header-pill-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.header-pill-btn.primary-install {
    background: var(--accent-color);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 16px rgba(239, 35, 60, 0.35);
}

.header-pill-btn.primary-install:hover {
    background: var(--accent-hover);
}

.header-pill-btn.is-installed {
    display: none;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffffff;
    color: #8a0303;
    font-size: 0.75rem;
    font-weight: 800;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.25s ease, background-color 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.06);
    background: rgba(255, 255, 255, 0.25);
}

/* =========================================================
   FORM ELEMANLARI VE GENEL BUTONLAR
   ========================================================= */

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--light-text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    height: 50px;
    padding: 12px 15px;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color var(--transition-speed);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(239, 35, 60, 0.16);
}

input[disabled] {
    opacity: 0.85;
    cursor: not-allowed;
    background-color: var(--weight-bg);
}

.calculate-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(239, 35, 60, 0.35);
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-top: 12px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(239, 35, 60, 0.45);
    filter: brightness(1.04);
}

.calculate-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: var(--text-color);
    color: var(--card-bg);
    border: none;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

/* =========================================================
   MODERN SWITCH
   ========================================================= */

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #b5bac2;
    transition: 0.3s;
    border-radius: 999px;
}

body.dark-mode .slider {
    background-color: #3a3f4b;
}

.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .slider {
    background-color: var(--accent-color);
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
}

/* =========================================================
   TOAST BİLDİRİM SİSTEMİ
   ========================================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(92vw, 420px);
    pointer-events: none;
}

.toast-item {
    background: #16181d;
    color: #ffffff;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-left: 4px solid var(--accent-color);
    animation: toastSlideUp 0.25s ease-out;
    pointer-events: auto;
}

.toast-item.toast-success {
    border-left-color: #3dd598;
}

.toast-item.toast-error {
    border-left-color: #ff4d4d;
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   UYGULAMA MODALLARI (KAYDET / PWA KURULUM)
   ========================================================= */

.app-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(8, 8, 12, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 16px;
    align-items: center;
    justify-content: center;
}

.app-modal-backdrop.open {
    display: flex;
}

.app-modal-dialog {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 20px;
    padding: 26px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    position: relative;
    animation: modalPopIn 0.22s ease-out;
}

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

.app-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--weight-bg);
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-modal-dialog h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 800;
    padding-right: 36px;
}

.app-modal-dialog p {
    margin: 0 0 16px;
    color: var(--light-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.app-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.app-modal-actions > * {
    flex: 1;
    min-width: 120px;
}

.install-steps-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--weight-bg);
    font-size: 0.88rem;
    font-weight: 600;
}

.install-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =========================================================
   PWA MOBİL KURULUM BANNERI
   ========================================================= */

.pwa-install-banner {
    display: none;
    width: calc(100% - 24px);
    max-width: 950px;
    margin: 14px auto 0;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--dashed-border);
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pwa-install-banner.visible {
    display: flex;
}

.pwa-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-left img {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    flex-shrink: 0;
}

.pwa-banner-left strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
}

.pwa-banner-left span {
    display: block;
    font-size: 0.8rem;
    color: var(--light-text);
    font-weight: 500;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-banner-install-btn {
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
}

.pwa-banner-close-btn {
    background: transparent;
    border: none;
    color: var(--light-text);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background-color: #0b090a;
    color: #9ba3af;
    padding: 32px 20px;
    width: 100%;
    text-align: center;
    font-size: 0.88rem;
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 800;
}

.footer-brand-row img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 4px 0;
}

.footer-links a {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-note {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #8b949e;
}

@media (max-width: 640px) {
    .header-inner {
        padding: 14px 14px 10px;
    }

    .brand-logo-img {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .brand-title {
        font-size: 1.38rem;
    }

    .brand-subtitle {
        font-size: 0.76rem;
    }

    .header-top-bar {
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .header-pill-btn {
        flex: 1 1 auto;
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .theme-toggle-btn {
        flex-shrink: 0;
    }

    .pwa-install-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .pwa-banner-actions {
        justify-content: flex-end;
    }
}
