/* Auth Modals CSS - Streamlined version with no duplication */

/* Modal Base Styles */
.modal {
    padding: 30px 15px;
    overflow-y: auto;
    max-height: 100vh; 
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.modal::-webkit-scrollbar {
    display: none;
}

.modal-content {
    max-height: 80vh;
    overflow-y: auto;
    margin: auto;
    padding: 25px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

/* Auth specific form styles */
.auth-login-form,
.auth-register-form {
    width: 100%;
}

.auth-form-row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.auth-input-group {
    margin-bottom: 15px;
    width: 100%;
}

.auth-input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.auth-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.auth-checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.auth-checkbox-group label {
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.auth-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.auth-buttons-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
}

.auth-login-btn, 
.auth-register-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.auth-login-btn:hover,
.auth-register-btn:hover {
    background-color: #f0c800;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.auth-login-btn i,
.auth-register-btn i {
    margin-left: 8px;
    font-size: 0.9rem;
}

/* Social Login Styles */
.auth-social-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
    position: relative;
}

.auth-social-divider::before,
.auth-social-divider::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-social-divider span {
    padding: 0 15px;
    color: var(--text-color-secondary);
    font-size: 0.85rem; 
}

.auth-google-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.auth-google-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.auth-google-btn img {
    width: 20px; 
    height: 20px; 
    margin-right: 8px;
}

/* Auth Modal Footer */
.auth-modal-footer {
    margin-top: 0px;
    text-align: center;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}

.auth-modal-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-modal-footer a:hover {
    text-decoration: underline;
}

/* Animation for Button Loading State */
@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form field error styling */
.auth-input-group .field-error {
    color: #ff4d4d;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.auth-input-group .input-error {
    border-color: #ff4d4d !important;
    box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.2) !important;
}

.auth-input-group .label-error {
    color: #ff4d4d !important;
}

/* Success message animation */
.modal-success.animated-success {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    background-color: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    border-radius: 8px;
    animation: successPulse 1.5s infinite;
}

.animated-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: successIconAnimation 1s ease-in-out;
}

@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

@keyframes successIconAnimation {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auth-buttons-row {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .modal {
        padding: 20px 10px;
    }
    
    .modal-content {
        padding: 20px 15px;
        max-height: 85vh;
    }
    
    .auth-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .auth-checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Fix vertical centering */
@media (min-height: 700px) {
    .modal {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Small devices height adjustments */
@media (max-height: 600px) {
    .modal-content {
        max-height: 90vh;
        padding: 15px;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .auth-input-group {
        margin-bottom: 10px;
    }
}

/* Password visibility toggle styling */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Make room for the icon */
.password-input-wrapper .auth-input {
    padding-right: 40px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .password-toggle {
        right: 10px;
        width: 20px;
        height: 20px;
    }
}




/* OTP input styling */
#otpCode {
    letter-spacing: 4px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}

.help-text-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.countdown {
    font-weight: 700;
    color: var(--primary-color);
}

.countdown.expired {
    color: #e74c3c;
}

.resend-otp-btn {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}

.resend-otp-btn:hover {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.resend-otp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.resend-otp-btn i {
    font-size: 0.8rem;
}

/* Center align all form buttons in auth modals */
.auth-buttons-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
    justify-content: center;
}

/* Make login/register form buttons more centered */
#forgotPasswordForm .auth-buttons-row,
#otpVerificationForm .auth-buttons-row,
#resetPasswordForm .auth-buttons-row {
    flex-direction: column;
    align-items: center;
}

/* Adjust submit buttons width */
#forgotPasswordForm .auth-login-btn,
#otpVerificationForm .auth-login-btn,
#resetPasswordForm .auth-login-btn {
    width: auto;
    min-width: 200px;
    max-width: 250px;
    margin: 0 auto;
}

/* Make sure form's submit button looks good on all modals */
.auth-login-btn, 
.auth-register-btn {
    flex: unset; /* Override flex: 1 property */
    padding: 10px 20px;
}

/* Adjust Google button */
.auth-google-btn {
    max-width: 250px;
    margin: 0 auto;
}

/* Animation for successful password reset */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.modal-success.animated-success {
    animation: successPulse 1.5s ease-in-out;
}

/* Shake animation for incorrect OTP */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

/* Reset button styles between form transitions */
#otpVerificationForm .auth-login-btn, 
#resetPasswordForm .auth-login-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Make sure OTP feedback is visible */
.modal-error {
    margin-bottom: 15px;
    background-color: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 10px 15px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-in-out;
    text-align: center;
}

.modal-success {
    margin-bottom: 15px;
    background-color: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    padding: 10px 15px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-in-out;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 768px) {
    .auth-buttons-row {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .auth-login-btn, 
    .auth-register-btn,
    .auth-google-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 576px) {
    .help-text-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .resend-otp-btn {
        margin-bottom: 8px;
    }
}