/* =========================================
   GLOBAL AYARLAR & TYPOGRAPHY
   ========================================= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5; /* Biraz daha koyu, kontrast yaratan gri */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    color: #333;
}

h1 {
    color: #1a1a1a;
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 700;
    letter-spacing: -0.5px; /* Başlıkları daha modern yapar */
}

/* =========================================
   KART YAPISI (FORM CONTAINER)
   ========================================= */
.form-container {
    background-color: #ffffff;
    padding: 40px; /* İç boşluğu artırdık */
    border-radius: 12px; /* Köşeleri daha yuvarlak */
    /* Daha modern, yaygın bir gölge (Soft Shadow) */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); 
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

/* =========================================
   INPUT & SELECT & TEXTAREA
   ========================================= */
.form-group {
    margin-bottom: 24px; /* Elemanlar arası boşluk arttı */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568; /* Simsiyah yerine koyu gri */
    font-size: 0.95rem;
}

/* Zorunlu alan yıldızı */
.form-group:has(:required)>label::after {
    content: "*";
    color: #e53e3e;
    font-weight: bold;
    margin-left: 4px;
}
.form-row {
    display: flex;
    gap: 15px; /* İki kutu arasındaki boşluk */
    margin-bottom: 15px; /* Satırın alt boşluğu */
}

/* Satır içindeki her bir grup eşit genişlikte olsun */
.form-row .form-group {
    flex: 1;
    margin-bottom: 0; /* İçerideki margin'i sıfırlıyoruz ki hizası bozulmasın */
}

/* Mobilde (dar ekranda) tekrar alt alta insinler diye (Opsiyonel ama tavsiye edilir) */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-row .form-group {
        margin-bottom: 15px;
    }
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px; /* İç boşluklar rahatlatıldı */
    border: 1px solid #e2e8f0; /* Çok açık gri sınır */
    background-color: #fff;
    border-radius: 8px; /* Input köşeleri */
    font-size: 15px;
    color: #2d3748;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Hafif iç derinlik */
}

/* Inputa tıklanınca (Focus) */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3182ce; /* Bitrix mavisine yakın */
    outline: none;
    /* Focus olduğunda etrafında modern bir hare (Ring) */
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15); 
}

/* Readonly inputlar */
.form-group input[readonly] {
    background-color: #f7fafc;
    border-color: #edf2f7;
    color: #718096;
    cursor: default;
}

/* Currency Input Özelleştirmesi */
.currency-input {
    display: flex;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-radius: 8px;
}

.currency-input input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none; /* Flex içinde çift gölge olmasın */
    z-index: 2;
}

.currency-input select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    width: 90px;
    border-left: 0;
    background-color: #f8fafc;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
}

.currency-input input:focus, 
.currency-input select:focus {
    z-index: 3; /* Focus olan öne çıksın */
}

/* =========================================
   BUTONLAR
   ========================================= */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%); /* Hafif gradyan */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px); /* Hoverda hafif yukarı kalkma */
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #cbd5e0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* İade butonu durumu */
body.refund-active .submit-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.3);
}

body.refund-active .submit-btn:hover {
    box-shadow: 0 6px 12px rgba(229, 62, 62, 0.4);
}

/* =========================================
   ÖZEL BİLEŞENLER (LOADER, NOTLAR VB.)
   ========================================= */

/* Loader (Dönen Çember) */
.loader {
    text-align: center;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader::before {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Balance Container (Bilgi Kartı) */
.balance-container {
    display: none;
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border-left: 5px solid #3182ce; /* Sol tarafa vurgu çizgisi */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.balance-container h3 {
    margin-top: 0;
    color: #2d3748;
    font-size: 1.1rem;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 10px;
}

.balance-positive { color: #38a169 !important; }
.balance-negative { color: #e53e3e !important; }

/* Booking Notes */
.booking-notes {
    margin-top: 20px !important;
    padding: 15px;
    background-color: #fff8e1; /* Not defteri sarısı */
    border: 1px solid #ffeebb;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #744210;
    line-height: 1.5;
}

/* Dış Kullanıcı / İç Kullanıcı Bölümleri */
#externalUserGroup {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* =========================================
   ÜRÜN LİSTESİ (GRID & TABLE)
   ========================================= */
.product-header {
    background-color: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #718096;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.product-row {
    background-color: #fff;
    border-bottom: 1px solid #edf2f7;
    padding: 8px 0;
    transition: background-color 0.2s;
}

.product-row:hover {
    background-color: #fcfcfc;
}

.product-row input {
    border: 1px solid transparent; /* Varsayılan olarak kenarlık yokmuş gibi */
    background: transparent;
    border-radius: 4px;
    text-align: center;
}

.product-row input:focus {
    border-color: #3182ce;
    background: #fff;
}

/* Silme Butonu */
.product-row .delete-btn {
    background-color: #fff;
    color: #e53e3e;
    border: 1px solid #fed7d7;
    padding: 0;
    cursor: pointer;
    border-radius: 6px;
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.product-row .delete-btn:hover {
    background-color: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

/* İsim Inputu */
.product-row .p-name-input {
    width: 100%;
    text-align: left !important;
    font-weight: 500;
    padding: 8px;
}

/* Switch (Slider) */
.refund-switch-container {
    margin-bottom: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between; /* Sağa yaslama yerine iki uca */
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    body {
        padding: 10px;
        background-color: #f0f2f5;
    }

    .form-container {
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    /* Mobilde inputlar biraz daha büyük olsun (Parmakla dokunmak için) */
    .form-group input, 
    .form-group select {
        padding: 14px; 
        font-size: 16px; /* iOS zoom engellemek için */
    }

    .product-row {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.03);
        /* Mobilde grid düzeni aynen korundu */
        display: grid;
        grid-template-columns: 1fr 1fr 1.2fr !important;
        grid-template-rows: auto auto;
        gap: 12px;
    }

    .product-row .delete-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        border: none;
        background: #fef2f2;
        color: #e53e3e;
        border-radius: 50%; /* Mobilde yuvarlak buton */
    }
    
}