/* public/css/style.css */

/* Genel Stil ve Mobil Uyumluluk */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #007bff;
    color: #fff;
    padding: 1rem;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

main {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #777;
    font-size: 0.9rem;
}

/* Navigasyon Menüsü */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #343a40;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-bottom: 20px;
}

.main-nav .nav-brand {
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: bold;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav ul li a {
    color: #f8f9fa;
    text-decoration: none;
    padding: 0.8rem 1rem;
    display: block;
    transition: background-color 0.3s;
}

.main-nav ul li a:hover {
    background-color: #495057;
    border-radius: 4px;
}

.main-nav .user-info {
    color: #fff;
}

.main-nav .user-info span {
    margin-right: 15px;
}

.main-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.currency-rates {
    color: #adb5bd;
}

.currency-rates span {
    margin-left: 15px;
}
.currency-rates b {
    color: #fff;
}


/* Butonlar */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Form Elemanları */
input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Önemli */
}

/* Teklif formu için özel stiller */
.proposal-form input[type="number"] {
    min-width: 100px;
    width: auto;
}

.proposal-form input[type="text"] {
    min-width: 150px;
}

/* Ürün tablosu için özel stiller */
.product-table input[type="number"] {
    min-width: 120px;
    width: 120px;
    text-align: right;
}

.product-table input[type="text"] {
    min-width: 200px;
    width: auto;
}

/* Teklif formu ürün tablosu için özel sütun genişlikleri */
.product-table th:nth-child(1), .product-table td:nth-child(1) { width: 45%; } /* Ürün/Hizmet */
.product-table th:nth-child(2), .product-table td:nth-child(2) { width: 12%; } /* Miktar */
.product-table th:nth-child(3), .product-table td:nth-child(3) { width: 15%; } /* Birim Fiyat */
.product-table th:nth-child(4), .product-table td:nth-child(4) { width: 15%; } /* Toplam */
.product-table th:nth-child(5), .product-table td:nth-child(5) { width: 13%; } /* İşlem */

/* Teklif formu ürün tablosu için özel stiller */
.product-table {
    table-layout: fixed;
    width: 100%;
}

.product-table td {
    padding: 8px 4px;
    vertical-align: middle;
}

.product-table input[type="text"] {
    width: 100%;
    min-width: auto;
    box-sizing: border-box;
}

.product-table input[type="number"] {
    width: 100%;
    min-width: auto;
    box-sizing: border-box;
    text-align: right;
}

/* Genel kar marjı alanı için özel stil */
.profit-margin-input {
    min-width: 120px !important;
    width: 120px !important;
}

/* Ürün yönetimi sayfası için özel stiller */
.product-management-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.product-management-form .form-group {
    margin-bottom: 0;
}

.product-management-form input[type="text"] {
    min-width: 150px;
    width: 100%;
}

.product-management-form input[type="number"] {
    min-width: 120px;
    width: 100%;
    text-align: right;
}

.product-management-form select {
    min-width: 120px;
    width: 100%;
}

.product-management-form button {
    width: 100%;
    min-height: 38px;
}

/* Tablo Stilleri */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.table th, .table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e9ecef;
}

/* Tablo sütun genişlikleri */
.table th:nth-child(1), .table td:nth-child(1) {width: 100%;}  /* # */
.table th:nth-child(2), .table td:nth-child(2) { width: 12%; } /* Teklif No */
.table th:nth-child(3), .table td:nth-child(3) { width: 20%; } /* Müşteri */
.table th:nth-child(4), .table td:nth-child(4) { width: 12%; } /* Yetkili */
.table th:nth-child(5), .table td:nth-child(5) { width: 12%; } /* Konu */
.table th:nth-child(6), .table td:nth-child(6) { width: 10%; } /* Tarih */
.table th:nth-child(7), .table td:nth-child(7) { width: 12%; } /* Tutar */
.table th:nth-child(8), .table td:nth-child(8) { width: 17%; } /* İşlem */

/* Buton grubu için ek stiller */
.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
}

.action-buttons .btn-sm {
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Araç Çubuğu ve Arama Formu */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
}

.search-form input[type="text"] {
    margin-bottom: 0;
    border-radius: 4px 0 0 4px;
}

.search-form button {
    padding: 10px 15px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

/* Uyarı Mesajları */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Küçük Butonlar */
.btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    border-radius: 0.2rem;
    text-decoration: none;
    display: inline-block !important;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 60px;
    text-align: center;
    margin-right: 3px;
    float: none !important;
    vertical-align: middle;
}

.btn-sm:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
    text-decoration: none;
}

.btn-sm:last-child {
    margin-right: 0;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Tablo hücrelerinde buton düzeni */
.table td {
    white-space: nowrap;
}

/* Butonların yan yana olmasını zorla */
.table td .btn-sm {
    display: inline-block !important;
    float: none !important;
    margin-right: 3px;
}

.table td .btn-sm:last-child {
    margin-right: 0;
}

/* İşlem sütunu için özel stil */
.table td:last-child {
    white-space: nowrap;
    text-align: left;
    padding: 8px 4px;
    min-width: 200px;
}

/* Teklifler tablosu için özel düzen */
.table:not(.customers-table) td:last-child {
    width: 17%;
    min-width: 220px;
}

/* Butonların yan yana olmasını zorla */
.table td:last-child .btn-sm {
    display: inline-block !important;
    float: none !important;
    margin-right: 3px;
    vertical-align: middle;
}

.table td:last-child .btn-sm:last-child {
    margin-right: 0;
}

/* İşlem sütunu için özel stil */
.product-table td:last-child {
    text-align: center;
    white-space: nowrap;
}

.product-table td:last-child button {
    min-width: 70px;
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Ürün listesi tablosu için özel stiller */
.products-table {
    table-layout: fixed;
    width: 100%;
}

.products-table th:nth-child(1), .products-table td:nth-child(1) { width: 15%; } /* Stok Kodu */
.products-table th:nth-child(2), .products-table td:nth-child(2) { width: 50%; } /* Ürün Adı */
.products-table th:nth-child(3), .products-table td:nth-child(3) { width: 15%; } /* Fiyat */
.products-table th:nth-child(4), .products-table td:nth-child(4) { width: 20%; } /* İşlemler */

.products-table td {
    padding: 8px 4px;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.products-table td:nth-child(2) { /* Ürün Adı sütunu */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Müşteri ismi kısaltma */
.customer-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Tablo hücrelerinde metin kısaltma */
.table td:nth-child(3) { /* Müşteri sütunu */
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table td:nth-child(3) strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Müşteri listesi için özel stiller */
.customers-table td:nth-child(2) { /* Firma Adı sütunu */
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customers-table td:nth-child(2) strong {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Müşteri listesi butonları için özel stiller */
.customers-table td:last-child {
    white-space: nowrap;
    text-align: left;
    padding: 8px 4px;
    min-width: 180px;
}

.customers-table td:last-child .btn-sm {
    display: inline-block !important;
    float: none !important;
    margin-right: 3px;
    vertical-align: middle;
    min-width: 65px;
}

.customers-table td:last-child .btn-sm:last-child {
    margin-right: 0;
}

/* Toplu işlem butonları için özel stil */
.bulk-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
}

.bulk-action-buttons .btn-sm {
    min-width: 120px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

/* Sayfa İçeriği Düzeni */
.page-header {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.content-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.panel-half {
    flex: 1;
    min-width: 300px;
}


/* Mobil için Ayarlar */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-form {
        width: 100%;
        margin-top: 10px;
    }
    .search-form input[type="text"] {
        width: 100%;
    }
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    .main-nav ul li a {
        padding: 0.5rem 0;
    }
    .main-nav .user-info {
        margin-top: 10px;
        width: 100%;
    }
    .main-nav .nav-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
} 