/* ====================================
   BIRLESTIRILMIS FIX DOSYASI
   (simple-fix, bootstrap-grid-fix, form-layout-fix, chrome-select-fix, select-fix)
   ==================================== */

/* ====================================
   1. SELECT ELEMENT FIXES
   ==================================== */

select.form-control,
select.form-select {
    /* Renk ve gorunurluk */
    color: var(--select-text) !important;
    background-color: var(--select-bg) !important;
    opacity: 1 !important;

    /* Webkit ozel duzeltmeleri */
    -webkit-text-fill-color: var(--select-text) !important;
    -webkit-opacity: 1 !important;

    /* Gorunum */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Boyut ve padding */
    display: block !important;
    width: 100% !important;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;

    /* Border */
    border: 1px solid var(--select-border) !important;
    border-radius: 0.25rem !important;
    background-clip: padding-box !important;

    /* Dropdown ok ikonu - Light mode */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;

    /* Transition */
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
    cursor: pointer !important;
}

/* Dark mode dropdown ok ikonu */
[data-theme="dark"] select.form-control,
[data-theme="dark"] select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
}

/* Hover state */
select.form-control:hover,
select.form-select:hover {
    border-color: var(--select-hover-border) !important;
}

/* Focus state */
select.form-control:focus,
select.form-select:focus {
    color: var(--select-text) !important;
    background-color: var(--select-bg) !important;
    border-color: var(--select-focus-border) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem var(--select-focus-shadow) !important;
    -webkit-text-fill-color: var(--select-text) !important;
}

/* Disabled state */
select.form-control:disabled,
select.form-select:disabled {
    background-color: var(--input-disabled-bg) !important;
    color: var(--input-disabled-text) !important;
    -webkit-text-fill-color: var(--input-disabled-text) !important;
    opacity: 1 !important;
}

/* Option styles */
select.form-control option,
select.form-select option {
    color: var(--select-option-text) !important;
    background-color: var(--select-option-bg) !important;
    -webkit-text-fill-color: var(--select-option-text) !important;
    padding: 8px !important;
}

/* Secili option */
select.form-control option:checked,
select.form-select option:checked {
    background-color: var(--select-option-checked-bg) !important;
    color: var(--select-option-checked-text) !important;
}

/* Chrome/Edge icin ozel duzeltmeler */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select.form-control,
    select.form-select {
        color: var(--select-text) !important;
        -webkit-text-fill-color: var(--select-text) !important;
    }
}

/* Firefox icin ozel duzeltmeler */
@-moz-document url-prefix() {
    select.form-control,
    select.form-select {
        color: var(--select-text) !important;
        text-shadow: 0 0 0 var(--select-text) !important;
    }
}

/* Safari icin ozel duzeltmeler */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        select.form-control,
        select.form-select {
            -webkit-text-fill-color: var(--select-text) !important;
            color: var(--select-text) !important;
        }
    }
}

/* ====================================
   2. BOOTSTRAP GRID FIXES
   ==================================== */

/* Container ve row duzeltmeleri */
.container,
.container-fluid {
    padding-right: 15px !important;
    padding-left: 15px !important;
}

.row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: -15px !important;
    margin-left: -15px !important;
}

.row > * {
    flex-shrink: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    margin-top: 0 !important;
}

/* Column duzeltmeleri */
[class*="col-"] {
    position: relative !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}

/* Large screens (>=992px) */
@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    .col-lg-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
    .col-lg-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    .col-lg-8 {
        flex: 0 0 66.666667% !important;
        max-width: 66.666667% !important;
    }
    .col-lg-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Medium screens (>=768px) */
@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    .col-md-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
    .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Small screens (>=576px) */
@media (min-width: 576px) {
    .col-sm-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* Extra small screens (<576px) */
@media (max-width: 575.98px) {
    .col-sm-12,
    [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ====================================
   3. FORM LAYOUT FIXES
   ==================================== */

/* Form control genislik garantisi */
.form-control {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Form group spacing */
.form-group {
    margin-bottom: 1rem !important;
}

/* Row icindeki form-group'lar icin ozel ayar */
.row .form-group {
    margin-bottom: 0.5rem !important;
}

/* Label ve input arasindaki bosluk */
.form-group label {
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Card body icindeki formlar icin */
.card-body {
    padding: 1.25rem !important;
}

.card-body form {
    width: 100% !important;
    padding: 0 !important;
}

/* Card body icindeki row icin ozel duzeltme */
.card-body > form > .row {
    margin-right: -15px !important;
    margin-left: -15px !important;
}

/* Margin bottom utility */
.mb-3 {
    margin-bottom: 1rem !important;
}

/* Checkbox'lar icin ozel duzenleme */
.form-check {
    margin-bottom: 0.5rem !important;
}

.form-check-inline {
    margin-right: 1rem !important;
}

/* Button row icin duzenleme */
.row .text-right {
    padding-right: 15px !important;
}

/* Alert ve progress bar'lar icin margin */
#queryPreview,
#progressContainer,
#statusContainer,
#completionContainer {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* Table responsive icin duzenleme */
.table-responsive {
    margin-top: 1.5rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Responsive icin ekstra margin */
@media (max-width: 991px) {
    .col-lg-3.mb-3 {
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 767px) {
    .col-md-6.mb-3 {
        margin-bottom: 1rem !important;
    }

    /* Mobilde form elementleri arasinda daha fazla bosluk */
    .form-group {
        margin-bottom: 1.5rem !important;
    }
}
