/* Compact Form Styles - Better spacing for all forms */

/* Label and input spacing */
.form-label {
    margin-bottom: 0 !important; /* Label direkt input'un üstünde */
    padding-bottom: 2px !important; /* Sadece 2px boşluk */
    font-weight: 500;
    font-size: 0.875rem; /* Kompakt font boyutu */
    color: #495057;
    display: block;
    line-height: 1.1; /* Sıkı line height */
}

/* Reduce spacing between form groups */
.mb-3 {
    margin-bottom: 0.625rem !important; /* Form grupları arası daha az boşluk */
}

.mb-4 {
    margin-bottom: 1.25rem !important;
}

/* Input groups - Label'dan hemen sonra başlar */
.input-group {
    margin-top: 0 !important;
}

/* Label'dan sonra gelen herhangi bir element */
.form-label + .input-group,
.form-label + .form-control,
.form-label + .form-select,
.form-label + .form-check,
.form-label + input,
.form-label + select,
.form-label + textarea {
    margin-top: 0 !important;
}

/* Form controls */
.form-control,
.form-select {
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
}

/* Input group text (icons) */
.input-group-text {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
}

/* Helper text under inputs */
small.text-muted,
.form-text {
    margin-top: 0.25rem;
    margin-bottom: 0;
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Invalid feedback */
.invalid-feedback {
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

/* Valid feedback */
.valid-feedback {
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

/* Section headers in forms */
h5.mb-3,
.form-section-header {
    margin-bottom: 1rem !important;
    margin-top: 1.5rem !important;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

h5.mb-3:first-of-type,
.form-section-header:first-child {
    margin-top: 0 !important;
}

/* Checkboxes and radios - Kare ve düzgün */
.form-check {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding-left: 0;
    display: flex;
    align-items: flex-start;
    min-height: 1.5rem;
}

.form-check-input {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    margin-right: 0.5rem !important;
    margin-top: 0.125rem !important;
    padding: 0;
    border: 2px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.15s ease-in-out;
}

.form-check-input[type="checkbox"] {
    border-radius: 0.25rem !important; /* Kare köşeler */
}

.form-check-input[type="radio"] {
    border-radius: 50% !important; /* Radio button yuvarlak */
}

.form-check-input:checked {
    background-color: #FFB700;
    border-color: #FFB700;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px;
}

.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    border-color: #FFB700;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(255, 183, 0, 0.25);
}

.form-check-input:hover:not(:disabled) {
    border-color: #FFB700;
}

.form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-check-label {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
}

/* Switch style checkboxes */
.form-switch {
    padding-left: 2.5rem;
}

.form-switch .form-check-input {
    width: 2rem;
    margin-left: -2.5rem;
}

/* Form buttons */
.btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Submit button spacing */
.d-grid.mt-4 {
    margin-top: 1.5rem !important;
}

.d-grid.gap-2 {
    gap: 0.75rem !important;
}

/* Card forms */
.card .card-body {
    padding: 2rem;
}

.card .card-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Row spacing in forms */
.row.g-3 {
    --bs-gutter-y: 0.875rem;
    --bs-gutter-x: 1rem;
}

/* Floating labels adjustment */
.form-floating > label {
    padding: 0.5rem 0.75rem;
}

.form-floating > .form-control {
    padding: 1rem 0.75rem 0.25rem;
}

/* Password visibility toggle button */
.password-toggle {
    cursor: pointer;
    padding: 0.5rem 0.75rem;
}

/* File input */
.form-control[type="file"] {
    padding: 0.375rem 0.75rem;
}

/* Range input */
.form-range {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Color input */
.form-control-color {
    max-width: 3rem;
    padding: 0.375rem;
}

/* Textarea */
textarea.form-control {
    min-height: calc(1.5em + 1rem + 2px);
}

/* Inline forms */
.row.align-items-end .form-label {
    margin-bottom: 0.25rem;
}

/* Required field indicator */
.form-label .text-danger,
.required-indicator {
    color: #dc3545;
    font-weight: 600;
    margin-left: 0.125rem;
}

/* Focus states */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 183, 0, 0.25);
    border-color: #FFB700;
}

/* Disabled states */
.form-control:disabled,
.form-select:disabled {
    background-color: #e9ecef;
    opacity: 0.65;
}

/* Read-only states */
.form-control[readonly] {
    background-color: #f8f9fa;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .form-label {
        font-size: 0.875rem;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem 0.75rem;
    }
    
    .input-group-text {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        min-height: 44px; /* iOS touch target */
    }
    
    .card .card-body {
        padding: 1.5rem;
    }
    
    h5.mb-3,
    .form-section-header {
        font-size: 1rem;
        margin-top: 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    small.text-muted,
    .form-text {
        font-size: 0.75rem;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .card .card-body {
        padding: 1rem;
    }
    
    .form-control,
    .form-select,
    .input-group-text {
        font-size: 16px;
        padding: 0.5rem 0.625rem;
    }
    
    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* Tablet adjustments */
@media (min-width: 577px) and (max-width: 768px) {
    .card .card-body {
        padding: 2rem;
    }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    .card .card-body {
        padding: 1rem 2rem;
    }
    
    .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    h5.mb-3,
    .form-section-header {
        margin-top: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
}