/* Windows 7 Teması - 1024x768 Çözünürlük İçin Optimize */
* {
    box-sizing: border-box;
}

body {
    background: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 12px;
    margin: 0;
    padding: 0;
    color: #000;
}

/* Ana Container - Tam genişlik */
.main-container {
    width: 100%;
    margin: 0;
    padding: 5px 8px;
}

/* Header - Windows 7 Başlık Çubuğu Stili */
.header {
    background: linear-gradient(to bottom, #f0f0f0 0%, #d0d0d0 100%);
    border: 1px solid #a0a0a0;
    color: #000;
    padding: 10px 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: normal;
}

/* Butonlar - Windows 7 Stili */
.btn {
    font-size: 11px;
    padding: 4px 12px;
    border: 1px solid #a0a0a0;
    background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
    color: #000;
    cursor: pointer;
    border-radius: 2px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.btn:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d8d8d8 100%);
    border-color: #808080;
}

.btn:active {
    background: linear-gradient(to bottom, #d0d0d0 0%, #c0c0c0 100%);
}

.btn-primary {
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border-color: #2e5c8a;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #5ba0f2 0%, #4a90e2 100%);
}

.btn-success {
    background: linear-gradient(to bottom, #5cb85c 0%, #4cae4c 100%);
    color: #fff;
    border-color: #4cae4c;
}

.btn-success:hover {
    background: linear-gradient(to bottom, #6cc86c 0%, #5cb85c 100%);
}

.btn-warning {
    background: linear-gradient(to bottom, #f0ad4e 0%, #eea236 100%);
    color: #000;
    border-color: #eea236;
}

.btn-warning:hover {
    background: linear-gradient(to bottom, #f5bd6e 0%, #f0ad4e 100%);
}

.btn-danger {
    background: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
    color: #fff;
    border-color: #c9302c;
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #e9635f 0%, #d9534f 100%);
}

.btn-secondary {
    background: linear-gradient(to bottom, #6c757d 0%, #5a6268 100%);
    color: #fff;
    border-color: #5a6268;
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #7c858d 0%, #6c757d 100%);
}

.btn-info {
    background: linear-gradient(to bottom, #5bc0de 0%, #46b8da 100%);
    color: #000;
    border-color: #46b8da;
}

.btn-info:hover {
    background: linear-gradient(to bottom, #6bd0ee 0%, #5bc0de 100%);
}

.btn-lg {
    font-size: 12px;
    padding: 6px 16px;
}

.btn-sm {
    font-size: 10px;
    padding: 2px 8px;
}

/* İşlem Butonları - Mobil Uyumlu */
.islem-butonlari {
    display: flex;
    align-items: center;
    gap: 5px;
}

.islem-btn {
    min-width: 32px;
    min-height: 28px;
    padding: 4px 10px !important;
    border: 2px solid !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.islem-btn.btn-warning {
    border-color: #d4a017 !important;
    background: linear-gradient(to bottom, #ffd700 0%, #ffb300 100%) !important;
}

.islem-btn.btn-warning:hover {
    border-color: #b8860b !important;
    background: linear-gradient(to bottom, #ffb300 0%, #ff8c00 100%) !important;
}

.islem-btn.btn-danger {
    border-color: #c9302c !important;
    background: linear-gradient(to bottom, #f44336 0%, #d32f2f 100%) !important;
}

.islem-btn.btn-danger:hover {
    border-color: #a02622 !important;
    background: linear-gradient(to bottom, #d32f2f 0%, #b71c1c 100%) !important;
}

/* Mobil için ekstra güvenlik */
@media (max-width: 768px) {
    .islem-btn {
        min-width: 36px;
        min-height: 32px;
        padding: 6px 12px !important;
        margin: 2px;
        border-width: 2px !important;
    }
    
    .islem-butonlari {
        gap: 8px;
    }
}

/* Arama Sonuçları Butonları */
.arama-islem-btn {
    min-width: 70px;
    min-height: 32px;
    padding: 6px 12px !important;
    border: 2px solid !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px !important;
    font-weight: 500;
    margin: 0 2px;
}

.arama-islem-btn.btn-success {
    border-color: #28a745 !important;
    background: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%) !important;
    color: #fff !important;
}

.arama-islem-btn.btn-success:hover {
    border-color: #1e7e34 !important;
    background: linear-gradient(to bottom, #449d44 0%, #2d6a2d 100%) !important;
}

.arama-islem-btn.btn-warning {
    border-color: #d4a017 !important;
    background: linear-gradient(to bottom, #ffd700 0%, #ffb300 100%) !important;
    color: #000 !important;
}

.arama-islem-btn.btn-warning:hover {
    border-color: #b8860b !important;
    background: linear-gradient(to bottom, #ffb300 0%, #ff8c00 100%) !important;
}

/* Arama sonuçları tablosu için buton container */
table .islem-butonlari {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .arama-islem-btn {
        min-width: 80px;
        min-height: 36px;
        padding: 8px 14px !important;
        margin: 3px;
        font-size: 12px !important;
    }
    
    table .islem-butonlari {
        gap: 8px;
    }
}

.btn-big {
    min-height: 60px;
    font-size: 14px;
    margin: 5px 0;
    padding: 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.btn-big i {
    font-size: 24px;
}

/* Kartlar - Windows 7 Panel Stili */
.card, .stat-card, .table-responsive, .satis-form, .defter-form, .kayit-listesi, .barkod-form, .sonuc-card {
    background: #fff;
    border: 1px solid #a0a0a0;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
    border-bottom: 1px solid #a0a0a0;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 13px;
}

.card-body {
    padding: 10px;
}

/* Tablolar - Kompakt ve Scroll */
.table-responsive {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: auto;
}

table td {
    word-wrap: break-word;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

table thead {
    background: linear-gradient(to bottom, #e0e0e0 0%, #d0d0d0 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

table th {
    padding: 6px 8px;
    text-align: left;
    border: 1px solid #a0a0a0;
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
}

table td {
    padding: 5px 8px;
    border: 1px solid #d0d0d0;
    font-size: 11px;
}

table tbody tr:hover {
    background: #f0f0f0;
}

table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* Form Elemanları */
.form-control, .form-select, select {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px solid #a0a0a0;
    background: #fff;
    border-radius: 2px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    width: 100%;
}

.form-control:focus, .form-select:focus, select:focus {
    outline: 1px solid #4a90e2;
    outline-offset: -1px;
    border-color: #4a90e2;
}

.form-control-lg {
    font-size: 12px;
    padding: 5px 10px;
}

/* Form Alanları - Belirgin Sınırlar */
.stok-form-kisa .form-label {
    margin-bottom: 4px;
    font-weight: 500;
    display: block;
}

.form-input-belirgin {
    border: 2px solid #808080 !important;
    padding: 6px 10px !important;
    margin-bottom: 8px;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: block;
    width: 100%;
}

.form-input-belirgin:focus {
    border-color: #4a90e2 !important;
    outline: 2px solid #4a90e2 !important;
    outline-offset: 1px;
    box-shadow: 0 0 4px rgba(74, 144, 226, 0.3);
}

/* Number Input Spinner'ları Kaldır */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner {
    -moz-appearance: textfield;
}

/* Kaydet Butonu - Mobil Uyumlu */
.kaydet-btn {
    margin-top: 0;
}

@media (max-width: 768px) {
    .kaydet-btn {
        margin-top: 10px !important;
    }
    
    .form-input-belirgin {
        margin-bottom: 12px;
    }
}

.form-label {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 3px;
    display: block;
}

/* Alert Mesajları */
.alert {
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 11px;
}

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

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* İstatistik Kartları */
.stat-card {
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
}

.stat-label {
    color: #666;
    font-size: 10px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    margin-top: 4px;
}

.green { color: #28a745; }
.red { color: #dc3545; }
.blue { color: #007bff; }
.orange { color: #fd7e14; }

/* Ürün Kartları */
.urun-card {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #a0a0a0;
}

.urun-card:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.urun-card.selected {
    border: 2px solid #28a745 !important;
    background: #d4edda !important;
}

/* Badge */
.badge {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 2px;
}

.bg-success {
    background: #28a745 !important;
    color: #fff;
}

.bg-danger {
    background: #dc3545 !important;
    color: #fff;
}

.bg-primary {
    background: #007bff !important;
    color: #fff;
}

/* Row ve Column Ayarları */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -5px;
    margin-right: -5px;
}

.row > * {
    padding-left: 5px;
    padding-right: 5px;
}

.g-3 {
    display: flex;
    flex-wrap: wrap;
    margin-left: -5px;
    margin-right: -5px;
}

.g-3 > * {
    padding-left: 5px;
    padding-right: 5px;
    margin-bottom: 5px;
}

/* Responsive - 1024x768 için */
@media (max-width: 1024px) {
    .main-container {
        max-width: 100%;
        padding: 5px;
    }
    
    .table-responsive {
        max-height: 400px;
    }
    
    table {
        font-size: 10px;
    }
    
    table th, table td {
        padding: 4px 6px;
    }
    
    .btn-big {
        min-height: 50px;
        font-size: 12px;
    }
    
    .btn-big i {
        font-size: 20px;
    }
}

/* Scrollbar Stili - Windows 7 */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #e0e0e0;
    border: 1px solid #c0c0c0;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #d0d0d0 0%, #c0c0c0 100%);
    border: 1px solid #a0a0a0;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #c0c0c0 0%, #b0b0b0 100%);
}

/* Özel Düzenlemeler */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 15px; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 10px; }
.mt-4 { margin-top: 15px; }

.ms-2 { margin-left: 8px; }

.text-center { text-align: center; }
.text-muted { color: #666; }

.fw-bold { font-weight: bold; }

.w-100 { width: 100%; }

.fs-4 { font-size: 16px; }
.fs-5 { font-size: 14px; }

/* Barkod Input Özel */
.barkod-input {
    font-size: 20px;
    text-align: center;
    letter-spacing: 3px;
    padding: 10px;
}

/* Günlük Özet Grid - Tüm ekran boyutları için */
.col-md-1 {
    flex: 0 0 8.333333%;
    max-width: 8.333333%;
    box-sizing: border-box;
}

.col-md-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
    box-sizing: border-box;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    box-sizing: border-box;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    box-sizing: border-box;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    box-sizing: border-box;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    box-sizing: border-box;
}

.col-md-10 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
    box-sizing: border-box;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Stok formu için kısa alanlar */
.stok-form-kisa .col-md-1 {
    max-width: 70px;
    flex: 0 0 70px;
}

/* Ürün Kartları - Satış Ekranı */
.urun-kartlari {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
}

.urun-kart {
    background: #fff;
    border: 1px solid #a0a0a0;
    border-radius: 3px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.urun-kart:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background: #f0f8ff;
}

.urun-kart.selected {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.urun-kart-adi {
    font-size: 11px;
    font-weight: bold;
    color: #000;
    margin-bottom: 5px;
    word-break: break-word;
    line-height: 1.3;
}

.urun-kart-fiyat {
    font-size: 12px;
    color: #28a745;
    font-weight: bold;
    margin-top: auto;
}

/* Sepet Stilleri */
.sepet-card {
    position: sticky;
    top: 10px;
}

.sepet-item {
    transition: background 0.2s;
}

.sepet-item:hover {
    background: #f8f9fa !important;
}

.gap-1 {
    gap: 4px;
}

/* Sayfalama */
.pagination-container {
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination .btn-sm {
    padding: 3px 8px;
    font-size: 11px;
}

.gap-2 {
    gap: 8px;
}

/* Küçük ekranlar için */
@media (max-width: 767px) {
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-10, .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .urun-kartlari {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ========== MOBİL GÖRÜNÜM (Elden geçirme) ========== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 0;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        -webkit-text-size-adjust: 100%;
    }
    
    .main-container {
        padding: 10px 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .header {
        padding: 12px 14px;
        margin-bottom: 14px;
    }
    
    .header h1 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .header .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header .btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .stat-card {
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .btn-big {
        min-height: 56px;
        font-size: 1rem;
        padding: 14px 12px;
        border-radius: 6px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-big i {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        max-height: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    table {
        font-size: 12px;
        min-width: 500px;
    }
    
    table th, table td {
        padding: 10px 8px;
    }
    
    .form-control, .form-select, select {
        font-size: 16px;
        padding: 10px 12px;
        min-height: 48px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .form-input-belirgin {
        padding: 10px 12px !important;
        min-height: 44px;
    }
    
    .card, .card-body, .defter-form, .barkod-form {
        padding: 14px;
    }
    
    .card-header {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .alert {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .barkod-input {
        font-size: 18px;
        padding: 14px;
        min-height: 48px;
    }
    
    .gap-2 {
        gap: 10px;
    }
    
    .gap-2 .btn {
        min-height: 44px;
        padding: 10px 14px;
    }
}

/* Login sayfası - mobil */
@media (max-width: 768px) {
    body.login-page {
        padding: 16px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        align-items: flex-start;
        padding-top: max(20px, env(safe-area-inset-top));
    }
    
    .login-wrapper {
        max-width: 100%;
    }
    
    .login-box {
        max-width: 100%;
        border-radius: 12px;
        box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    }
    
    .login-header {
        padding: 22px 20px;
    }
    
    .login-header .login-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .login-body {
        padding: 22px 20px;
    }
    
    .login-box .form-control {
        font-size: 16px;
        min-height: 50px;
    }
    
    .login-box .btn-login {
        min-height: 50px;
    }
    
    .login-footer {
        padding: 14px 20px;
    }
}

/* PWA - Ana ekrana ekle banner */
.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    border-top: 1px solid #a0a0a0;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    z-index: 9999;
}
.pwa-banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
}
.pwa-banner-text {
    font-size: 13px;
    color: #333;
    flex: 1;
    min-width: 180px;
}
.pwa-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pwa-banner .btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}
.pwa-ios-hint {
    font-size: 11px;
    color: #666;
    margin: 8px 0 0;
    text-align: center;
}
@media (max-width: 768px) {
    .pwa-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .pwa-banner-actions {
        justify-content: flex-end;
    }
}

