/* assets/css/style.css */

/* --- 1. GENEL AYARLAR ve TİPOGRAFİ --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* --- 2. HEADER ve NAVİGASYON --- */
header {
    background-color: #343a40;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

nav h1 a {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #495057;
    text-decoration: none;
}

/* --- 3. GİRİŞ/KAYIT FORMLARI (auth-form) --- */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-top: 5px solid #007bff; /* Mavi çizgi */
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #343a40;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.auth-form button[type="submit"] {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.auth-form button[type="submit"]:hover {
    background-color: #0056b3;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

/* --- 4. MESAJLAR --- */
.hata, .basari {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.hata {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.basari {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* --- 5. FOOTER --- */
footer {
    text-align: center;
    padding: 10px 0;
    margin-top: 20px;
    color: #6c757d;
    font-size: 0.8rem;
    position: fixed;
    bottom: 0;
    width: 100%;
}
/* --- 6. DASHBOARD ve TABLO STİLLERİ --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.dashboard-header h2 {
    color: #007bff;
    font-size: 1.8rem;
}

.dashboard-header p {
    color: #666;
}

/* Genel Buton Stilleri */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}
.btn-info:hover {
    background-color: #117a8b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Veri Tablosu Stili */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    border: 1px solid #dee2e6;
    padding: 12px 15px;
    text-align: left;
}

.data-table th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: bold;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tbody tr:hover {
    background-color: #e2e6ea;
}

.data-table .islemler a {
    text-decoration: none; /* Buton olarak göründüğü için alt çizgi olmasın */
}

.bilgi {
    text-align: center;
    padding: 20px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
}   
/* --- 7. TEKLİF OLUŞTURMA SAYFASI STİLLERİ --- */
.teklif-olustur h2 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.form-section {
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fcfcfc;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.form-group-inline {
    display: flex;
    gap: 20px;
}

.form-group-inline .half {
    flex: 1;
}

/* Input Tablosu */
.input-table input[type="text"], 
.input-table input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
}

.input-table input[name="malzeme_adi[]"] {
    text-align: left;
}

.input-table td {
    padding: 5px;
}

.input-table .sira_no {
    text-align: center;
    font-weight: bold;
}

/* Toplam Alanları */
.totals-area {
    float: right;
    width: 400px;
    margin-left: 20px;
    border-left: 4px solid #007bff;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dotted #ccc;
}

.total-row:last-child {
    border-bottom: none;
}

.net-total span:first-child {
    font-weight: normal;
    color: #666;
}

.grand-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
}

.kdv-section {
    align-items: center;
}

#kdvTutariText {
    font-weight: bold;
    color: #009900;
}

.kdv-hidden {
    visibility: hidden; /* JavaScript ile görünür yapılacaktır */
}

.kdv-dipnot {
    margin-top: 20px;
    font-style: italic;
    color: #999;
}

/* Kaydet Buton Alanı */
.form-submit-area {
    clear: both; /* Float'u temizle */
    padding-top: 20px;
    text-align: center;
}

.btn-success {
    background-color: #28a745;
    color: white;
    font-size: 1.1rem;
    padding: 12px 25px;
}
.btn-success:hover {
    background-color: #1e7e34;
}

/* Ek olarak: Küçük cihazlarda toplam alanını düzeltme */
@media (max-width: 768px) {
    .totals-area {
        width: 100%;
        float: none;
        margin-left: 0;
    }
}
/* --- 8. TEKLİF GÖRÜNTÜLEME SAYFASI STİLLERİ (view_offer.php) --- */
.teklif-goruntule {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.teklif-goruntule h2 {
    color: #343a40;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.teklif-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

/* Üst Bilgi Alanı */
.teklif-header-info {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.teklif-header-info p {
    margin: 5px 0;
    font-size: 1em;
}
.teklif-header-info strong {
    color: #007bff;
}

/* Toplam Alanları (Görüntüleme Modu) */
.totals-area.view-mode {
    float: right;
    width: 400px;
    margin-left: 20px;
    padding: 10px;
    background-color: #e9f5ff; /* Açık mavi arka plan */
    border: 1px solid #cce5ff;
    border-left: 5px solid #007bff; /* Mavi çizgi */
    border-radius: 6px;
}

.totals-area.view-mode .total-row {
    border-bottom: 1px dashed #b8daff;
}

.totals-area.view-mode .total-row:last-child {
    border-bottom: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #007bff;
}

.kdv-hidden {
    display: none !important; /* KDV sıfırsa satırı tamamen gizle */
}

/* Dip Notlar */
.teklif-dipnotlar {
    clear: both;
    margin-top: 20px;
    padding: 15px;
    border: 1px dashed #ccc;
    background-color: #fffbeb;
    border-radius: 4px;
}

/* Yazdırma Butonu Stili */
.btn-warning {
    background-color: #ffc107;
    color: #333;
}
.btn-warning:hover {
    background-color: #e0a800;
}

/* Yazdırma/PDF Ortamı Ayarları */
@media print {
    /* Header ve Footer'ı gizle */
    header, footer, .teklif-actions, .btn {
        display: none !important;
    }
    
    /* Görüntüleme sayfasını tam sayfa yap */
    .teklif-goruntule {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Toplam alanının konumunu düzelt */
    .totals-area.view-mode {
        float: right;
        width: 350px;
        margin-left: 0;
        margin-top: 20px;
        box-shadow: none;
    }
    
    /* Tablo stili */
    .data-table {
        font-size: 10pt;
    }
}
/* --- 9. LOGO YÜKLEME VE KARŞILAMA STİLLERİ --- */

/* Dashboard Karşılama Alanı Stilleri */
.welcome-area {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #007bff;
    border-left: 5px solid #007bff;
    background-color: #e9f0ff;
    border-radius: 5px;
}

.welcome-area h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.welcome-logo {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

/* Ayarlar Sayfası Stilleri (settings.php) */
.settings-page {
    max-width: 600px;
    margin: 30px auto;
}

.logo-preview-area {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    text-align: center;
    background-color: #f9f9f9;
}

.current-logo {
    max-width: 150px;
    height: auto;
    border: 1px solid #ccc;
    padding: 5px;
    background-color: white;
    border-radius: 4px;
}

/* Teklif Görüntüleme Sayfası Logo Stilleri */
.teklif-header-logo {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
}

.teklif-header-logo h1 {
    font-size: 1.8rem;
    color: #343a40;
    margin: 0;
}

.offer-logo-image {
    max-width: 250px; /* Teklif sayfasında daha büyük logo */
    height: auto;
    border: 1px solid #eee;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
}
/* --- NORMAL GÖRÜNÜM İYİLEŞTİRMELERİ (Normal CSS Alanına Eklenecek) --- */

.teklif-kurumsal-bilgi {
    text-align: right;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}
.teklif-musteri-bilgi {
    margin-bottom: 30px;
    padding: 10px;
    border: 1px dashed #ddd;
}

/* Günlük görünümde alt detaylar */
.footer-details {
    overflow: auto; /* Normal float'ları temizler */
    margin-top: 50px;
    padding-bottom: 50px;
}
.imza-alani {
    float: left; /* Normalde solda durur */
    width: 300px;
    text-align: center;
    margin-top: 50px;
    font-size: 0.9em;
}


/* --- 10. YAZDIRMA (PDF ÇIKTISI) STİLLERİ --- */

/* --- 10. YAZDIRMA (PDF ÇIKTISI) STİLLERİ - TEK SAYFA OPTİMİZASYONU --- */

@media print {
    /* 1. GEREKSİZ EKRAN ÖĞELERİNİ GİZLE (Önceki Adımlar) */
    header, 
    footer, 
    .teklif-actions, 
    .btn, 
    .form-submit-area {
        display: none !important;
        visibility: hidden !important;
    }

    /* 2. ANA KAPSAYICILARI TEMİZLE VE GENEL SIKILAŞTIRMA */
    /* Sayfa kenar boşluklarını sıfırlayarak alandan kazanılır */
    @page {
        margin: 0.5cm; /* Sayfa kenar boşluğunu küçült */
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background-color: #fff !important;
        
        /* KRİTİK: Genel yazı tipini küçült */
        font-family: Arial, sans-serif;
        font-size: 8.5pt; /* Varsayılan 10pt yerine 8.5pt kullan */
    }

    /* 3. BAŞLIK VE LOGO ALANI */
    .teklif-header-logo {
        margin-bottom: 10px; /* Boşluk azaltıldı */
        padding-bottom: 5px; /* Boşluk azaltıldı */
    }
    .offer-logo-image {
        max-width: 120px; /* Logo biraz daha küçültüldü */
    }
    .teklif-kurumsal-bilgi p {
        margin: 2px 0; /* Satır aralığı azaltıldı */
        font-size: 9pt;
    }

    /* 4. TEKLİF KALEMLERİ TABLOSU SIKILAŞTIRMA */
    .offer-table th, .offer-table td {
        padding: 4px 6px; /* İç boşluklar azaltıldı */
        font-size: 8pt;
    }
    
    /* Sütun Genişliklerini Optimize Etme */
    .offer-table th:nth-child(2) { width: 35%; } /* Malzeme Adı */
    .offer-table th:nth-child(3) { width: 20%; } /* Marka/Model */
    .offer-table th:nth-child(4) { width: 8%; }  /* Birim */
    .offer-table th:nth-child(5) { width: 8%; }  /* Miktar */
    
    /* 5. TOPLAMLAR VE İMZA ALANINI SIKIŞTIRMA */
    .footer-details {
        margin-top: 20px; /* Boşluk azaltıldı */
    }
    .imza-alani {
        width: 250px; /* İmza alanı küçültüldü */
        margin-top: 30px;
    }
    .totals-area.view-mode {
        width: 300px; /* Toplam alanı küçültüldü */
    }
    .total-row span {
        font-size: 9pt; /* Toplam yazıları küçültüldü */
    }

    /* Dip Notlar */
    .teklif-dipnotlar {
        margin-top: 15px; /* Boşluk azaltıldı */
    }
}/* --- BUTON STİL GÜNCELLEMESİ (EN ALTTA EKLENECEK) --- */

/* 1. Ana Aksiyon Butonu: KAYDET / OLUŞTUR (btn-success) */
.btn-success {
    /* Genel Görünüm */
    background-color: #28a745;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 12px 30px;
    border: none;
    border-radius: 8px; /* Yumuşak köşeler */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.3); /* Hafif gölge */
    text-transform: uppercase;
}

.btn-success:hover {
    background-color: #1e8731; /* Hover'da daha koyu yeşil */
    box-shadow: 0 6px 10px rgba(40, 167, 69, 0.4); /* Gölgeyi büyüt */
    transform: translateY(-2px); /* Hafif yukarı hareket */
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(40, 167, 69, 0.3);
}

/* 2. Yeni Teklif/KDV Butonu (btn-primary) */
.btn-primary {
    background-color: #007bff;
    color: white;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn-primary:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* 3. Küçük İşlem Butonları (Listeleme Ekranı: btn-sm, btn-secondary, btn-info, btn-danger) */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    margin-left: 5px;
    transition: opacity 0.2s;
    opacity: 0.9;
}

.btn-sm:hover {
    opacity: 1;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-info { /* Görüntüle */
    background-color: #17a2b8;
    color: white;
}

.btn-danger { /* Sil */
    background-color: #dc3545;
    color: white;
}
/* assets/css/style.css dosyasındaki .search-input stilini değiştirin */

.search-input {
    /* Temel Görünüm */
    padding: 10px 15px; /* İç boşluğu artırdık */
    border: 1px solid #ced4da; /* Sade kenarlık */
    border-radius: 6px; /* Köşeleri yuvarladık */
    width: 250px; /* Genişliği biraz artırdık */
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    /* Odaklanma Efekti */
    border-color: #80bdff; /* Mavi odaklanma rengi */
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Hafif mavi parlama */
}

/* Arama Formu alanı düzenlemesi */
.search-form-area {
    /* Bu alanın içinde Flexbox varsa hizalamayı korur */
    display: flex;
    align-items: center;
    gap: 15px;
}