/* =============================================================================
   DOSYA: style.css (Açık Tema - Sade ve Okunaklı) - SON DÜZENLEME
   AÇIKLAMA: Açık gri, beyaz ağırlıklı, minimalist tasarım ve tüm buton/navigasyon düzenlemeleri.
   GÜNCELLEME: Buton dikey hizalaması ve padding ayarları, search input ile eşitlendi. Font Awesome ikon butonları için stiller eklendi.
============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Ana Renkler */
    --primary-color: #2d3436;       /* Koyu Gri (Ana Metin ve Header) */
    --primary-hover: #4a5154;
    --bg-body: #f4f6f8;             /* Sayfa Arka Planı: Çok açık gri */
    --bg-card: #ffffff;             /* Kart/Kutu Arka Planı: Beyaz */

    /* Vurgu Renkleri */
    --accent-color: #0984e3;        /* Parlak Mavi (Ana Vurgu) */
    --accent-hover: #00a8ff;        /* Açık Mavi */

    /* Metin Renkleri */
    --text-main: #2d3436;           /* Koyu Gri */
    --text-muted: #636e72;          /* Orta Gri */

    /* Durum Renkleri */
    --success: #00b894;             /* Yeşil */
    --success-hover: #00a082;       /* Yeşil Hover */
    --danger: #d63031;              /* Kırmızı */
    --danger-hover: #c0392b;        /* Kırmızı Hover */
    --warning: #ffbe76;             /* Turuncu */

    /* Yapısal */
    --border-radius: 8px;
    --border-color: #dfe6e9;        /* Açık Kenarlık Rengi */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--accent-color); transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* --- Container ve Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* --- Header (Üst Menü) --- */
.main-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.main-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* Header içi Arama Çubuğu Stilleri */
.header-search {
    flex-grow: 1;
    margin: 0 30px;
}

.header-search form {
    width: 100%;
}

.header-search-input {
    width: 100%;
    /* KRİTİK: Dikey padding artırıldı (0.7rem'den 0.8rem'e) */
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-body);
    font-size: 1rem;
    transition: var(--transition);
}

.header-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.15);
    background: var(--bg-card);
}

/* --- Butonlar --- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    color: white;
    /* KRİTİK: Dikey padding artırıldı (0.7rem'den 0.8rem'e) */
    padding: 0.8rem 1.4rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    gap: 0;
}

/* KRİTİK: Sadece simgeler için özel stil (Arama çubuğu ile boyut eşitleme) */
.main-header nav .button {
    gap: 0; /* İkonlar metin olmadığı için boşluk sıfırlandı */
    font-size: 1.1rem; /* İkonların boyutunu artırıldı */
    padding: 0.8rem 1rem; /* Sadece ikon olduğu için yatay padding azaltıldı, dikey padding input ile aynı */
}


.button:hover { background-color: #0984e396; color: white; }

.button-secondary { background-color: var(--text-muted); color: white; }
.button-secondary:hover { background-color: #7f8c8d; color: white; }

.button-danger { background-color: var(--danger); color: white; }
.button-danger:hover { background-color: var(--danger-hover); }

/* Genel Küçük Buton Stili (Admin paneli listeleme için) */
.button-small {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
}

/* Tablo içi aksiyon butonlarının hizalanması ve boşluğu */
td.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Tablo içi işlem butonları için özel stil */
td.actions .button,
td.actions .button-small {
    padding: 0.5rem 0.8rem;
    width: auto;
    height: auto;
    font-size: 0.9rem; /* İkonların görünürlüğü için büyütüldü. */
    box-shadow: none;
    text-transform: none;
    line-height: 1; /* İkonların dikey hizalaması için eklendi. */
}

/* --- Tablolar (Ana Yapı) --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

thead {
    background-color: #636e72;
    border-bottom: 1px solid var(--border-color);
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

tbody tr:hover {
    background-color: #fafafa;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    transition: transform 0.1s ease-in-out;
}
tr:last-child td { border-bottom: none; }


/* --- Formlar ve Filtreler --- */
input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-main);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.15);
    background: var(--bg-card);
}

/* --- Diğer Stiller (Login, Mesajlar, Admin Formları vb.) --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 40px);
}

.login-container {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-top: 5px solid var(--accent-color);
    border: 1px solid var(--border-color);
}

.login-container h2 { color: var(--primary-color); margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* --- Mesaj Kutuları --- */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-left: 5px solid;
}
.error-message {
    background-color: #ffebe8;
    color: #c0392b;
    border-left-color: var(--danger);
}
.success-message {
    background-color: #e5f9f6;
    color: #008a70;
    border-left-color: var(--success);
}

/* --- Admin Formları --- */
.admin-form {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}
.admin-form h2 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}
.form-row {
    display: flex;
    gap: 20px;
}
.form-row .form-group {
    flex: 1;
}
.form-actions {
    text-align: right;
    margin-top: 20px;
}
/* Responsive Form Ayarı */
@media (max-width: 600px) {
    .form-row { flex-direction: column; gap: 0; }
}

/* =============================================================================
   HİZALAMA SINIFLARI
============================================================================= */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* İşlem butonu sütunları için başlık ve hücre hizalaması */
th.actions, td.actions {
    text-align: center !important;
    width: 150px;
}


/* =============================================================================
   YÖNETİM PANELİ GRUPLAMA VE NAVİGASYON STİLLERİ
============================================================================= */

/* Yönetim Paneli Barı (Navigasyon + Aksiyon Butonları) */
.admin-panel-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 1rem 0 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

/* Yönetim Navigasyonu (Ürünler, Kullanıcılar) */
.admin-nav {
    display: flex;
    gap: 5px;
    padding-bottom: 0;
    margin-bottom: -1px;
}

/* Aksiyon Butonları Konteyneri */
.admin-actions-bar {
    display: flex;
    gap: 10px;
    padding-bottom: 0.5rem;
}

.button-admin-nav {
    /* Yönetim sekmesi görünümü ver */
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 0.7rem 1.2rem;
    font-weight: 500;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    box-shadow: none;
    transition: background-color 0.2s;
    text-transform: none;
}

.button-admin-nav:hover {
    background-color: var(--bg-body);
    color: var(--accent-color);
    box-shadow: none;
}

/* Aktif Sekme Stili */
.button-admin-nav.active {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    font-weight: 700;
    color: var(--primary-color);
}

/* Yönetim Hareketi Butonları (Yeni Ürün Ekle, Yeni Kullanıcı Ekle) */
.button-admin-action {
    background-color: var(--success);
    color: white;
    border: none;
    text-transform: uppercase;
}
.button-admin-action:hover {
    background-color: var(--success-hover);
    color: white;
}

/* Tablo Başlığı Düzeni (admin.php için artık sadece h2'leri etkilemeli) */
.admin-panel .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.admin-panel .table-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Responsive (Mobil Uyumu) */
@media (max-width: 768px) {
    .container { padding: 10px; }

    /* KRİTİK: Header içeriğini alt alta sırala */
    .main-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    /* Yeni arama çubuğu için mobil ayar */
    .header-search {
        margin: 0;
        width: 100%;
        max-width: none;
    }

    .main-header nav { display: flex; flex-direction: column; width: 100%; gap: 10px; }
    .button { width: 100%; }

    /* Mobil uyum (admin-nav) */
    /* Yeni Admin Panel Barı Mobil Uyumu */
    .admin-panel-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 1rem;
    }

    .admin-nav {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 0;
    }

    .button-admin-nav {
        border-radius: var(--border-radius);
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: center;
    }
    .button-admin-nav.active {
        border-bottom: 1px solid var(--border-color);
    }

    .admin-actions-bar {
        padding-bottom: 0;
        width: 100%;
    }
    .button-admin-action {
        width: 100%;
    }

    /* Mobilde tabloyu kart görünümüne çevir */
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }

    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 1rem;
        background: var(--bg-card);
        box-shadow: var(--shadow-sm);
    }
    td {
        border: none;
        padding: 0.5rem 0;
        position: relative;
        padding-left: 50%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Mobil aksiyonlar (Butonları yine yan yana tutmak için) */
    td.actions {
        justify-content: flex-end;
        gap: 8px;
    }

    td:before {
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-muted);
        content: attr(data-label);
    }
}
