/* Phone Input Component Styles */
.phone-input-container {
    margin-bottom: 1rem;
}

.phone-input-container .input-group {
    position: relative;
}

.country-select-wrapper {
    position: relative;
    flex-shrink: 0;
}

.country-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
    background-color: #f8f9fa;
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.country-select:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.country-select:focus {
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}

.phone-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
    transition: all 0.2s ease-in-out;
}

.phone-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    z-index: 2;
}

/* Ülke seçenekleri için özel stiller */
.country-select option {
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* Responsive tasarım */
@media (max-width: 576px) {
    .phone-input-container .input-group {
        flex-direction: column;
    }

    .country-select-wrapper {
        margin-bottom: 0.5rem;
    }

    .country-select,
    .phone-input {
        border-radius: 0.375rem;
        border: 1px solid #dee2e6;
    }

    .country-select {
        border-bottom: 0;
        margin-bottom: -1px;
    }
}

/* Dark mode desteği */
[data-layout="dark-layout"] .country-select {
    background-color: #2c2c2c;
    color: #e9ecef;
    border-color: #495057;
}

[data-layout="dark-layout"] .country-select:hover {
    background-color: #3a3a3a;
    border-color: #6c757d;
}

[data-layout="dark-layout"] .country-select:focus {
    background-color: #2c2c2c;
    border-color: #86b7fe;
}

/* Validation stilleri */
.phone-input.is-invalid {
    border-color: #dc3545;
}

.phone-input.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.phone-input.is-valid {
    border-color: #198754;
}

.phone-input.is-valid:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Loading state */
.phone-input-container.loading .country-select,
.phone-input-container.loading .phone-input {
    opacity: 0.6;
    pointer-events: none;
}

.phone-input-container.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Custom select arrow */
.country-select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #6c757d;
    pointer-events: none;
    transition: transform 0.2s ease;
    z-index: 1;
}

.country-select:focus + .country-select-wrapper::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Browser default arrow'u gizle */
.country-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
}

/* Hover effects */
.phone-input-container:hover .country-select {
    border-color: #adb5bd;
}

.phone-input-container:hover .phone-input {
    border-color: #adb5bd;
}

/* Focus ring animation */
.phone-input:focus,
.country-select:focus {
    animation: focusRing 0.2s ease-out;
}

@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }
}

/* Error state animation */
.phone-input.is-invalid {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Success state animation */
.phone-input.is-valid {
    animation: successPulse 0.5s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Placeholder styles */
.phone-input::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.phone-input:focus::placeholder {
    opacity: 0.5;
}

/* Disabled state */
.phone-input:disabled,
.country-select:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Readonly state */
.phone-input[readonly] {
    background-color: #f8f9fa;
    cursor: default;
}

/* Large size variant */
.phone-input-container.large .country-select,
.phone-input-container.large .phone-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* Small size variant */
.phone-input-container.small .country-select,
.phone-input-container.small .phone-input {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Compact variant */
.phone-input-container.compact .country-select {
    min-width: 100px;
}

.phone-input-container.compact .phone-input {
    font-size: 0.875rem;
}

/* Bordered variant */
.phone-input-container.bordered .country-select,
.phone-input-container.bordered .phone-input {
    border-width: 2px;
}

/* Rounded variant */
.phone-input-container.rounded .country-select,
.phone-input-container.rounded .phone-input {
    border-radius: 25px;
}

/* Shadow variant */
.phone-input-container.shadow .country-select,
.phone-input-container.shadow .phone-input {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.phone-input-container.shadow .country-select:focus,
.phone-input-container.shadow .phone-input:focus {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
