/* ============================================
   AVTOBAZA - Main Styles
   Modern Register/Login Modal & Components
   Created: December 5, 2024
   ============================================ */

/* ============================================
   1. REGISTER/LOGIN MODAL STYLES
   ============================================ */

/* Modal Backdrop */
#feedbackRegisterModal.modal {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Floating Label Styles */
.floating-group {
    position: relative;
}

.floating-group .form-control {
    padding-top: 1.25rem;
}

.floating-group .floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #6c757d;
    transition: all 0.18s ease;
    pointer-events: none;
    background: transparent;
    padding: 0 4px;
}

.floating-group .form-control:focus + .floating-label,
.floating-group .form-control:not(:placeholder-shown) + .floating-label {
    top: -6px;
    transform: none;
    font-size: 12px;
    color: #3f51b5;
    background: #fff;
}

/* Phone Input Styling */
#phone_number {
    letter-spacing: 0.3px;
}

/* Modal Modernization */
.modal .modal-content {
    border-radius: 16px !important;
    border: 1px solid #e7e7e7;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 455px !important;
}

.modal .modal-header {
    border-bottom: none;
    padding-bottom: 0.25rem;
}

.modal .modal-body {
    padding-top: 0.5rem;
}

/* Button Modernization */
.btn {
    border-radius: 12px !important;
    padding: 0.6rem 1rem;
    font-weight: 600;
}

.btn.btn-primary {
    background: #3f51b5;
    border-color: #3f51b5;
}

.btn.btn-primary:hover {
    filter: brightness(1.05);
}

/* OTP Section Styling */
#otp-section {
    margin-top: 16px;
}

.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 12px 0 6px;
}

.otp-input {
    width: 52px;
    height: 52px;
    border: 1px solid #ced4da;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.otp-input:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}

.otp-timer {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    margin-bottom: 10px;
}

/* Form Controls Focus State */
#feedbackRegisterModal .form-control:focus {
    border-color: #ffb91d !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 185, 29, 0.1);
}

/* OTP Input Focus State */
#feedbackRegisterModal .otp-input:focus {
    border-color: #ffb91d !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 185, 29, 0.1);
    transform: scale(1.05);
}

/* Button Hover Effects */
#feedbackRegisterModal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 185, 29, 0.4) !important;
}

#feedbackRegisterModal button:active {
    transform: translateY(0);
}

/* Floating Label Group */
#feedbackRegisterModal .floating-group {
    position: relative;
}

#feedbackRegisterModal .floating-label {
    position: absolute;
    left: 15px;
    top: 15px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 5px;
}

#feedbackRegisterModal .form-control:focus + .floating-label,
#feedbackRegisterModal .form-control:not(:placeholder-shown) + .floating-label {
    top: -10px;
    font-size: 12px;
    color: #ffb91d;
}

/* OTP Input States */
#feedbackRegisterModal .otp-input.filled {
    border-color: #4caf50;
    background: #f0f9f4;
}

#feedbackRegisterModal .otp-input.error {
    border-color: #dc3545;
    animation: shake 0.5s;
}

/* ============================================
   2. ANIMATIONS
   ============================================ */

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.05); 
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { 
        transform: translateX(0); 
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: translateX(-5px); 
    }
    20%, 40%, 60%, 80% { 
        transform: translateX(5px); 
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Scale Animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spin Animation */
@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* ============================================
   3. FIND PART MODAL STYLES
   ============================================ */

/* Modal Backdrop */
#findPartModal.modal {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Form Control Focus */
#findPartModal .form-control:focus {
    border-color: #ffb91d;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 185, 29, 0.1);
}

/* Submit Button Hover */
#findPartModal button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 185, 29, 0.4);
}

#findPartModal button[type="submit"]:active {
    transform: translateY(0);
}

/* File Upload Button Hover */
#findPartModal .custom-file-upload button:hover {
    border-color: #ffb91d;
    background: #fff8e6;
}

/* VIN Input Uppercase */
#vin_number {
    text-transform: uppercase;
}

/* Image Preview Animation */
#vehicle_registration_preview img,
#part_photo_preview img {
    animation: fadeInScale 0.3s ease-in;
}

/* ============================================
   4. UTILITY CLASSES
   ============================================ */

/* Text Truncate */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cursor Pointer */
.cursor-pointer {
    cursor: pointer;
}

/* ============================================
   5. RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    #feedbackRegisterModal .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
    
    #feedbackRegisterModal .otp-input {
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
    }
    
    #findPartModal .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
}

/* ============================================
   6. CUSTOM SCROLLBAR
   ============================================ */

#searchDropdown::-webkit-scrollbar {
    width: 8px;
}

#searchDropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#searchDropdown::-webkit-scrollbar-thumb {
    background: #ffb91d;
    border-radius: 4px;
}

#searchDropdown::-webkit-scrollbar-thumb:hover {
    background: #ffa500;
}

/* ============================================
   7. LOADING STATES
   ============================================ */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

/* ============================================
   8. FORM VALIDATION STYLES
   ============================================ */

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #4caf50;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

.valid-feedback {
    display: block;
    color: #4caf50;
    font-size: 13px;
    margin-top: 5px;
}

/* ============================================
   9. BADGE & ALERT STYLES
   ============================================ */

.badge-success {
    background-color: #4caf50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.badge-warning {
    background-color: #ffb91d;
    color: #0f0f4c;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* ============================================
   10. TRANSITIONS
   ============================================ */

.smooth-transition {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   END OF MAIN.CSS
   ============================================ */

