/* assets/style.css - İYİLEŞTİRİLMİŞ VERSİYON */

/* 1. Ana Taşıyıcı Kutu - TAM GENİŞLİK */
.imh-wrapper {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 25px;
    border-radius: 8px;
    width: 100%; /* max-width yerine full width */
    margin: 20px 0; /* auto margin kaldırıldı */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Tüm elemanlar için kutu modelini sabitle */
.imh-wrapper * {
    box-sizing: border-box;
}

/* 2. Başlıklar ve Etiketler */
.imh-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #23282d;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 12px;
    font-weight: 700;
}

.imh-group {
    margin-bottom: 22px;
}

.imh-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95em;
}

/* 3. Input Alanları - GELİŞTİRİLMİŞ */
.imh-wrapper input[type="text"],
.imh-wrapper input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
    background-color: #fff;
    height: auto;
    line-height: normal;
}

.imh-wrapper input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background-color: #f8fbfd;
}

.imh-wrapper input::placeholder {
    color: #999;
    opacity: 1;
}

/* 4. Radio Buttonlar (Mal Türü) - GELİŞTİRİLMİŞ */
.imh-radios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 5px;
}

.imh-radios label {
    font-weight: normal !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f7f7f7;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 0.92em;
    transition: all 0.2s ease;
    text-align: center;
}

.imh-radios label:hover {
    background: #e8f4f8;
    border-color: #0073aa;
    transform: translateY(-1px);
}

.imh-radios input[type="radio"]:checked + label,
.imh-radios label:has(input[type="radio"]:checked) {
    background: #0073aa;
    color: white;
    border-color: #005177;
    font-weight: 600 !important;
}

.imh-radios input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* 5. KDV Butonları - GELİŞTİRİLMİŞ */
.imh-kdv-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

.kdv-btn {
    padding: 12px 8px;
    background: #f7f7f7;
    border: 2px solid #ddd;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    color: #555;
    transition: all 0.2s ease;
    text-align: center;
}

.kdv-btn:hover {
    background: #e8f4f8;
    border-color: #0073aa;
    transform: translateY(-1px);
}

.kdv-btn.active {
    background: #0073aa;
    color: white;
    border-color: #005177;
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.3);
}

/* 6. Dinamik Ekstra Satırlar (Masraflar) - GELİŞTİRİLMİŞ */
#extra-expenses {
    margin-top: 10px;
}

.extra-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.extra-row .extra-name,
.extra-row .extra-expense-amount {
    margin: 0;
}

.del-btn {
    background: #d63638;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.del-btn:hover {
    background: #b32d2e;
    transform: scale(1.05);
}

/* Masraf Ekle Butonu - GELİŞTİRİLMİŞ */
#add-expense-btn {
    background: #f3f4f5;
    color: #2271b1;
    border: 2px solid #2271b1;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.2s ease;
    display: inline-block;
}

#add-expense-btn:hover {
    background: #2271b1;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
}

/* 7. Sonuç Alanı - GELİŞTİRİLMİŞ */
.imh-result {
    margin-top: 30px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95em;
    color: #555;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.result-row:last-of-type {
    margin-bottom: 0;
}

.result-row span:first-child {
    font-weight: 500;
}

.result-row span:last-child {
    font-weight: 700;
    color: #2c3338;
    font-size: 1.05em;
}

.result-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 3px solid #0073aa;
    font-size: 1.4em;
    font-weight: 800;
    color: #2c3338;
}

.result-total span:last-child {
    color: #0073aa;
    text-shadow: 0 1px 2px rgba(0, 115, 170, 0.2);
}

/* 8. Bilgi Kutucukları - GELİŞTİRİLMİŞ */
.imh-info-box {
    background: linear-gradient(135deg, #e7f5fe 0%, #d4edfc 100%);
    border-left: 5px solid #0073aa;
    padding: 14px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 0.9em;
    color: #0c5460;
    line-height: 1.5;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.1);
}

.sub-box {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e5 100%);
    border: 2px solid #f0c33c;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(240, 195, 60, 0.15);
}

.sub-box small {
    display: block;
    margin-top: 8px;
    line-height: 1.4;
}

/* Yardımcı Not Kutusu */
.imh-wrapper p {
    line-height: 1.5;
}

/* 9. Mobil Uyumluluk (Responsive) - GELİŞTİRİLMİŞ */
@media screen and (max-width: 768px) {
    .imh-wrapper {
        padding: 20px 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .imh-wrapper h3 {
        font-size: 1.3em;
    }
    
    .imh-radios {
        grid-template-columns: 1fr;
    }

    .imh-kdv-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kdv-btn {
        padding: 10px 6px;
        font-size: 0.9em;
    }
}

@media screen and (max-width: 480px) {
    .imh-wrapper {
        padding: 15px 12px;
    }
    
    .imh-wrapper h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .extra-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .del-btn {
        width: 100%;
        padding: 10px;
    }

    .result-row {
        font-size: 0.88em;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .result-total {
        font-size: 1.2em;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .imh-info-box,
    .sub-box {
        padding: 12px;
        font-size: 0.85em;
    }
}

/* 10. Animasyonlar ve Geçişler */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.imh-result {
    animation: fadeIn 0.3s ease-out;
}

.extra-row {
    animation: fadeIn 0.2s ease-out;
}

/* 11. Print Stili (İsteğe bağlı) */
@media print {
    .imh-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    #add-expense-btn,
    .del-btn {
        display: none;
    }
    
    .imh-radios,
    .imh-kdv-buttons,
    input {
        pointer-events: none;
    }
}