/**
 * Input Atom Styles
 * 
 * Professional form input styling following Atomic Design principles.
 * Supports outlined, filled, and default variants with validation states.
 * 
 * @package Mendene_Location
 * @subpackage CSS\Atoms
 * @version 1.0.0
 */

/* ============================================
   BASE INPUT STYLES
   ============================================ */

.input {
    width: 100%;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    background-color: transparent;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.input::placeholder {
    color: #999;
    opacity: 1;
    transition: color 0.3s ease;
}

.input:focus::placeholder {
    color: #bbb;
}

/* ============================================
   INPUT WRAPPER
   ============================================ */

.input__wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input__wrapper .input__icon {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
}

.input__wrapper.input--icon-left {
    padding-left: 0;
}

.input__wrapper.input--icon-left input {
    padding-left: 45px;
}

.input__wrapper.input--icon-right {
    padding-right: 0;
}

.input__wrapper.input--icon-right input {
    padding-right: 45px;
}

.input__wrapper.input--icon-left .input__icon {
    left: 15px;
}

.input__wrapper.input--icon-right .input__icon {
    right: 15px;
}

/* ============================================
   INPUT VARIANTS
   ============================================ */

/* Outlined Variant (Default for forms) */
.input--outlined {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input--outlined:hover:not(:disabled):not(.input--disabled) {
    border-color: #b0b0b0;
}

.input--outlined:focus {
    border-color: #7D4096;
    box-shadow: 0 0 0 4px rgba(125, 64, 150, 0.1);
    outline: none;
}

.input--outlined.input--error {
    border-color: #e74c3c;
}

.input--outlined.input--error:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.input--outlined.input--success {
    border-color: #27ae60;
}

.input--outlined.input--success:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

/* Filled Variant */
.input--filled {
    padding: 14px 18px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    background-color: #f5f5f5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input--filled:hover:not(:disabled):not(.input--disabled) {
    background-color: #eeeeee;
    border-bottom-color: #b0b0b0;
}

.input--filled:focus {
    background-color: #ffffff;
    border-bottom-color: #7D4096;
    box-shadow: 0 2px 8px rgba(125, 64, 150, 0.1);
}

.input--filled.input--error {
    border-bottom-color: #e74c3c;
}

.input--filled.input--success {
    border-bottom-color: #27ae60;
}

/* Default Variant */
.input--default {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #ffffff;
}

.input--default:focus {
    border-color: #7D4096;
    box-shadow: 0 0 0 3px rgba(125, 64, 150, 0.1);
}

/* ============================================
   INPUT SIZES
   ============================================ */

.input--small {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
}

.input--medium {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 12px;
}

.input--large {
    padding: 16px 20px;
    font-size: 18px;
    border-radius: 14px;
}

.input--large.input--outlined {
    padding: 16px 20px;
}

/* ============================================
   INPUT STATES
   ============================================ */

.input--disabled,
.input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
    pointer-events: none;
}

.input--error {
    color: #e74c3c;
}

.input--success {
    color: #27ae60;
}

/* ============================================
   INPUT CONTAINER
   ============================================ */

.input-container {
    margin-bottom: 24px;
    width: 100%;
}

.input-container--error {
    margin-bottom: 28px;
}

/* ============================================
   INPUT LABEL
   ============================================ */

.input__label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.input-container:focus-within .input__label {
    color: #7D4096;
}

.input-container--error .input__label {
    color: #e74c3c;
}

.input-container--error:focus-within .input__label {
    color: #e74c3c;
}

/* Required Indicator */
.input__required {
    color: #7D4096;
    font-weight: 700;
    margin-left: 2px;
}

.input-container--error .input__required {
    color: #e74c3c;
}

/* ============================================
   INPUT ERROR MESSAGE
   ============================================ */

.input__error {
    display: block;
    font-size: 13px;
    color: #e74c3c;
    margin-top: 6px;
    line-height: 1.4;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   INPUT SUCCESS STATE
   ============================================ */

.input-container--success .input__label {
    color: #27ae60;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .input--large {
        padding: 14px 18px;
        font-size: 16px;
    }
    
    .input--outlined {
        border-radius: 10px;
    }
    
    .input__label {
        font-size: 14px;
    }
    
    .input-container {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .input--large {
        padding: 12px 16px;
    }
    
    .input__wrapper.input--icon-left {
        padding-left: 40px;
    }
    
    .input__wrapper.input--icon-right {
        padding-right: 40px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.input:focus-visible {
    outline: 2px solid #7D4096;
    outline-offset: 2px;
}

.input--error:focus-visible {
    outline-color: #e74c3c;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .input--outlined {
        border-width: 3px;
    }
    
    .input:focus {
        outline: 3px solid #7D4096;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .input,
    .input__label,
    .input__error {
        transition: none;
    }
    
    .input__error {
        animation: none;
    }
}

