/* Genel Stil Sıfırlamaları ve Temel Ayarlar */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden; /* Yatay kaydırmayı engeller */
}

body {
    font-family: 'Inter', sans-serif; /* Modern ve okunaklı font */
    background-color: #f8f9fa; /* Çok açık gri arka plan */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 0; /* Navigasyon menüsü en üstte olacak */
    box-sizing: border-box;
    color: #343a40; /* Koyu gri metin rengi */
}

/* Navigasyon Menüsü Stilleri */
.main-nav {
    width: 100%;
    background-color: #212529; /* Koyu lacivert/siyah tonu */
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); /* Daha belirgin ve derin gölge */
    margin-bottom: 40px; /* İçerikle arasında daha fazla boşluk */
    box-sizing: border-box;
    position: sticky; /* Menüyü sayfanın üstünde sabitler */
    top: 0;
    z-index: 1000; /* Diğer her şeyin üzerinde */
}

.nav-brand a {
    color: #e9ecef; /* Açık gri marka rengi */
    font-size: 2.2em;
    font-weight: 800; /* Ekstra kalın font */
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: -0.8px;
}

.nav-brand a:hover {
    color: #007bff; /* Mavi vurgu */
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 35px; /* Daha fazla bağlantılar arası boşluk */
}

.nav-links li a {
    color: #e9ecef;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px; /* Daha yuvarlak köşeler */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links li a:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-2px); /* Hafif yukarı kayma efekti */
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.nav-links li a i {
    font-size: 1em;
}

/* Ana Konteyner ve Genel Sayfa Stilleri */
.container {
    max-width: 950px; /* Biraz daha geniş konteyner */
    width: 100%;
    margin: 20px auto 40px auto; /* Alttan daha fazla boşluk */
    background-color: #ffffff;
    padding: 40px; /* Daha fazla padding */
    border-radius: 20px; /* Daha da yuvarlak köşeler */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); /* Daha belirgin ve yumuşak gölge */
    box-sizing: border-box;
    position: relative;
}

h2 {
    text-align: center;
    color: #212529; /* Başlık rengi menü ile uyumlu */
    margin-bottom: 35px; /* Daha fazla boşluk */
    font-size: 2.8em;
    font-weight: 700;
    letter-spacing: -0.8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05); /* Hafif metin gölgesi */
}

/* Form Grupları */
.form-group {
    margin-bottom: 25px; /* Daha fazla boşluk */
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057; /* Koyu gri etiket */
    font-size: 1.1em;
}

.form-control {
    width: 100%;
    padding: 14px 18px; /* Daha fazla padding */
    border: 1px solid #ced4da; /* Daha yumuşak kenarlık */
    border-radius: 10px; /* Daha yuvarlak köşeler */
    box-sizing: border-box;
    font-size: 1.05em;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 5px rgba(0, 123, 255, 0.2); /* Daha yumuşak ve geniş gölge */
    outline: none;
}

/* Tablo Stilleri */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 35px;
    border-radius: 12px; /* Daha yuvarlak köşeler */
    overflow: hidden;
    table-layout: fixed;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); /* Yumuşak tablo gölgesi */
}

table th, table td {
    border: 1px solid #e9ecef;
    padding: 18px 20px; /* Daha fazla padding */
    text-align: left;
    vertical-align: middle;
    position: relative;
}

table th {
    background-color: #e9ecef; /* Başlık arka planı */
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* Tablo İçindeki Inputlar */
table input[type="text"],
table input[type="number"] {
    width: calc(100% - 16px); /* Padding'i hesaba kat */
    padding: 12px 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

table input[type="text"]:focus,
table input[type="number"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    outline: none;
}

/* Toplam Etiketleri */
table td.total-label {
    text-align: right;
    font-weight: bold;
    font-size: 1.2em;
    color: #343a40;
    padding-right: 25px;
}

#grandTotal {
    font-weight: bold;
    color: #28a745; /* Canlı yeşil */
    font-size: 1.4em;
    text-align: left;
}

/* Satır Sil Butonu */
.remove-row-btn {
    background-color: #dc3545; /* Kırmızı */
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.2);
}

.remove-row-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(220, 53, 69, 0.3);
}

.remove-row-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(220, 53, 69, 0.2);
}

/* Genel Aksiyon Butonları */
#addRowBtn, #saveReceiptBtn, .action-button {
    background-color: #007bff; /* Mavi */
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    margin-right: 20px;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.25);
}

#addRowBtn:hover, #saveReceiptBtn:hover, .action-button:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.35);
}

#addRowBtn:active, #saveReceiptBtn:active, .action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.secondary-button {
    background-color: #6c757d; /* Gri */
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.25);
}

.secondary-button:hover {
    background-color: #5a6268;
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.35);
}

/* Öneri Kutuları (Ürün ve Cari) */
.product-suggestions, .cari-suggestions {
    position: absolute;
    top: calc(100% + 5px); /* Input'un biraz altında */
    left: 0;
    border: 1px solid #e0e0e0;
    max-height: 220px; /* Daha fazla yükseklik */
    overflow-y: auto;
    background-color: #ffffff;
    z-index: 100;
    width: var(--input-width, 100%); /* Varsayılan 100% */
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 10px; /* Daha yuvarlak köşeler */
    box-sizing: border-box;
}

.product-suggestions div, .cari-suggestions div {
    padding: 14px 20px; /* Daha fazla padding */
    cursor: pointer;
    font-size: 1em;
    color: #343a40;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f2f2f2; /* Daha açık çizgi */
}

.product-suggestions div:hover, .cari-suggestions div:hover {
    background-color: #e9f0f5; /* Hafif mavi vurgu */
}

.product-suggestions div:last-child, .cari-suggestions div:last-child {
    border-bottom: none;
}

/* Bildirim Kutusu */
.notification-box {
    position: fixed;
    top: 30px; /* Daha fazla üstten boşluk */
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 20px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out, background-color 0.3s ease;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.notification-box.show {
    opacity: 1;
    visibility: visible;
}

.notification-box.success {
    background-color: #28a745; /* Canlı yeşil */
}

.notification-box.error {
    background-color: #dc3545; /* Canlı kırmızı */
}

.notification-icon {
    font-size: 1.5em;
}

/* Dashboard Stilleri */
.dashboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh; /* Menüden sonra kalan alan */
}

.dashboard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 30px; /* Daha fazla boşluk */
    justify-content: center;
    margin-top: 50px;
}

.dashboard-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #343a40;
    background-color: #ffffff;
    padding: 35px 40px;
    border-radius: 15px; /* Daha yuvarlak köşeler */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 220px;
    text-align: center;
    border: 1px solid #e0e0e0; /* Hafif kenarlık */
}

.dashboard-link:hover {
    background-color: #f2f4f7; /* Hafif vurgu */
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: #007bff; /* Hover'da mavi kenarlık */
}

.dashboard-link i {
    font-size: 4em; /* Daha büyük ikon */
    margin-bottom: 25px;
    color: #007bff;
}

.dashboard-link span {
    font-size: 1.4em;
    font-weight: 600;
}

/* Duyarlı Tasarım */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
        margin-bottom: 25px;
    }

    .nav-brand {
        margin-bottom: 15px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        width: calc(100% - 20px);
        text-align: left;
        padding: 12px;
        justify-content: flex-start;
    }

    .container {
        padding: 25px;
        margin: 15px auto;
    }

    h2 {
        font-size: 2.2em;
        margin-bottom: 25px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 1em;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    table th, table td {
        padding: 12px 15px;
        font-size: 0.85em;
    }

    table input[type="text"],
    table input[type="number"] {
        padding: 8px 6px;
        font-size: 0.9em;
    }

    .remove-row-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    #addRowBtn, #saveReceiptBtn, .action-button {
        padding: 12px 20px;
        font-size: 1em;
        margin-right: 10px;
    }

    .product-suggestions, .cari-suggestions {
        width: 100%;
    }

    .notification-box {
        width: 95%;
        left: 2.5%;
        transform: translateX(-50%);
        padding: 15px 20px;
        font-size: 1.1em;
    }

    .dashboard-links {
        gap: 20px;
        margin-top: 30px;
    }

    .dashboard-link {
        padding: 25px 30px;
        min-width: 180px;
    }

    .dashboard-link i {
        font-size: 3em;
        margin-bottom: 15px;
    }

    .dashboard-link span {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .main-nav {
        padding: 12px 15px;
    }
    .nav-brand a {
        font-size: 1.8em;
    }
    .nav-links li a {
        font-size: 1em;
        padding: 10px;
    }

    .container {
        padding: 20px;
        margin: 10px auto;
    }

    h2 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    table th, table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        display: block;
        padding: 15px;
    }

    table td:before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 90px;
        margin-right: 10px;
        color: #555;
    }

    table td:nth-of-type(1):before { content: "Ürün:"; }
    table td:nth-of-type(2):before { content: "Adet:"; }
    table td:nth-of-type(3):before { content: "Birim Fiyat:"; }
    table td:nth-of-type(4):before { content: "İskonto:"; }
    table td:nth-of-type(5):before { content: "Toplam:"; }
    table td:nth-of-type(6):before { content: ""; }

    table td.total-label {
        text-align: left;
        width: auto;
        display: inline-block;
        padding-right: 0;
    }

    #grandTotal {
        display: inline-block;
        width: auto;
        margin-left: 0;
        font-size: 1.2em;
    }

    .remove-row-btn {
        width: 100%;
        margin-top: 15px;
        padding: 10px;
    }

    #addRowBtn, #saveReceiptBtn, .action-button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        padding: 12px;
    }

    .dashboard-links {
        flex-direction: column;
        gap: 15px;
    }

    .dashboard-link {
        width: 100%;
        min-width: unset;
        padding: 20px;
    }

    .dashboard-link i {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    .dashboard-link span {
        font-size: 1.1em;
    }
}
