/* Modern Phone Input Styles */
.phone-input-wrapper {
    position: relative;
    display: flex;
    gap: 0.5rem;
    direction: rtl;
    align-items: stretch;
}

.phone-input-container {
    position: relative;
    flex: 1;
    display: flex;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.phone-input-container:focus-within {
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 0.2rem var(--input-focus-shadow) !important;
}

.phone-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    background: var(--input-bg);
    border-left: 1px solid var(--input-border);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.phone-area-code {
    width: 90px;
    padding: 0.75rem 0.75rem;
    background: transparent;
    border: none;
    border-left: 1px solid var(--input-border);
    color: var(--input-text) !important;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    direction: ltr;
}

.phone-area-code::placeholder {
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
}

.phone-separator {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    user-select: none;
}

.phone-main-number {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--input-text) !important;
    font-size: 0.95rem;
    outline: none;
    direction: ltr;
    text-align: left;
}

.phone-main-number::placeholder {
    color: var(--text-secondary) !important;
}

/* Hover effect */
.phone-input-container:hover {
    border-color: var(--input-focus-border) !important;
}

/* Alternative compact style */
.phone-input-compact {
    display: flex;
    gap: 0.5rem;
    direction: rtl;
}

.phone-input-compact .phone-segment {
    position: relative;
}

.phone-input-compact .phone-segment input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 0.375rem;
    color: var(--input-text) !important;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    direction: ltr;
    text-align: center;
}

.phone-input-compact .phone-segment input:focus {
    outline: none;
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 0.2rem var(--input-focus-shadow) !important;
}

.phone-input-compact .phone-segment input::placeholder {
    color: var(--text-secondary) !important;
}

.phone-input-compact .phone-segment-area {
    width: 90px;
}

.phone-input-compact .phone-segment-number {
    flex: 1;
}

.phone-input-compact .phone-segment-label {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--bg-secondary, #1e293b);
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    border-radius: 4px;
    pointer-events: none;
}

/* Modern Unified Style (Recommended) */
.phone-input-modern {
    position: relative;
    display: flex;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    direction: rtl;
}

.phone-input-modern:focus-within {
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 0.2rem var(--input-focus-shadow) !important;
}

.phone-input-modern:hover {
    border-color: var(--input-focus-border) !important;
}

.phone-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.875rem;
    background: var(--input-bg);
    border-left: 1px solid var(--input-border);
}

.phone-icon-box i {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.phone-number-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-left: 1px solid var(--input-border);
    color: var(--input-text) !important;
    font-size: 0.95rem;
    outline: none;
    direction: ltr;
    text-align: left;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.phone-number-input::placeholder {
    color: var(--text-secondary) !important;
}

.phone-divider {
    display: flex;
    align-items: center;
    padding: 0 0.625rem;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.2rem;
    user-select: none;
}

.phone-area-input {
    width: 85px;
    padding: 0.75rem 0.625rem;
    background: transparent;
    border: none;
    color: var(--input-text) !important;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    direction: ltr;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.phone-area-input::placeholder {
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .phone-input-modern {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .phone-icon-box {
        display: none !important;
    }
    
    .phone-area-input {
        width: 65px !important;
        min-width: 65px !important;
        max-width: 65px !important;
        flex: 0 0 65px !important;
        padding: 0.75rem 0.25rem !important;
        font-size: 0.8rem !important;
        text-align: center !important;
    }
    
    .phone-divider {
        padding: 0 0.2rem !important;
        font-size: 0.9rem !important;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .phone-number-input {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
        text-align: left !important;
        border-left: 1px solid var(--input-border) !important;
    }
    
    .phone-input-wrapper,
    .phone-input-compact {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }
    
    .phone-input-compact .phone-segment-area {
        width: 65px !important;
        flex-shrink: 0 !important;
    }
    
    .phone-area-code {
        width: 65px !important;
        flex-shrink: 0 !important;
    }
    
    .phone-main-number {
        flex: 1 !important;
        min-width: 0 !important;
    }
}

@media (max-width: 480px) {
    .phone-area-input {
        width: 55px !important;
        min-width: 55px !important;
        max-width: 55px !important;
        flex: 0 0 55px !important;
        font-size: 0.75rem !important;
    }
    
    .phone-divider {
        font-size: 0.8rem !important;
        padding: 0 0.15rem !important;
    }
    
    .phone-number-input {
        font-size: 0.8rem !important;
        padding: 0.75rem 0.25rem !important;
    }
}

/* Error state */
.phone-input-modern.error {
    border-color: var(--accent-red) !important;
}

.phone-input-modern.error:focus-within {
    box-shadow: 0 0 0 0.2rem var(--accent-red) !important;
}

/* Success state */
.phone-input-modern.success {
    border-color: var(--accent-green) !important;
}

.phone-input-modern.success:focus-within {
    box-shadow: 0 0 0 0.2rem var(--accent-green) !important;
}
