/* Modal styling for consistent use across the site */

/* Basic modal structure */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: var(--modal-z-index);
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    width: 480px;
    max-width: 90vw;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s ease, height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Minimal open-only animation */
.modal-content.modal-opening {
    animation: modalPopIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    z-index: calc(var(--modal-z-index) + 1);
    padding: 8px;
    line-height: 1;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(230, 57, 70, 0.1);
    color: #e63946;
    transform: scale(1.1);
}

.modal-title {
    margin-top: 0;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Form Styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    color: #2c3e50;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* Enhanced validation states */
.form-group.has-error input {
    border-color: #e74c3c;
    background-color: #fdf2f2;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-group.has-success input {
    border-color: #27ae60;
    background-color: #f2f9f5;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.form-group.has-warning input {
    border-color: #f39c12;
    background-color: #fef9f2;
    box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.1);
}

/* Modern Tab Navigation */
.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 6px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    --tab-width: 50%;
    --tab-offset: 0px;
}

.tab-buttons::after {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: var(--tab-offset, 4px);
    width: calc(var(--tab-width, 0) - 8px);
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tab-btn {
    flex: 1;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #7f8c8d;
    transition: all 0.3s ease;
    border-radius: 8px;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn.active {
    color: #ffffff;
}

.tab-btn:hover:not(.active) {
    color: #34495e;
    background: rgba(255, 255, 255, 0.5);
}

/* Enhanced Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tab-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* Modern Button Styles */
#userLoginSubmitBtn,
#staffLoginSubmitBtn,
#userSignupSubmitBtn,
#forgotPasswordSubmitBtn {
    width: 280px;
    max-width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #e63946 0%, #c62d42 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin: 24px auto 16px auto;
    display: block;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
    position: relative;
    overflow: hidden;
}

#userLoginSubmitBtn:hover,
#staffLoginSubmitBtn:hover,
#userSignupSubmitBtn:hover,
#forgotPasswordSubmitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4);
}

#userLoginSubmitBtn::before,
#staffLoginSubmitBtn::before,
#userSignupSubmitBtn::before,
#forgotPasswordSubmitBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#userLoginSubmitBtn:hover::before,
#staffLoginSubmitBtn:hover::before,
#userSignupSubmitBtn:hover::before,
#forgotPasswordSubmitBtn:hover::before {
    left: 100%;
}

/* Enhanced Password Strength */
.password-strength {
    margin-top: 12px;
    display: none;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.password-strength.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.strength-bar {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.4s ease;
    border-radius: 3px;
}

.strength-fill.weak {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    width: 25%;
}

.strength-fill.fair {
    background: linear-gradient(90deg, #f39c12, #d68910);
    width: 50%;
}

.strength-fill.good {
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: 75%;
}

.strength-fill.strong {
    background: linear-gradient(90deg, #27ae60, #229954);
    width: 100%;
}

.strength-text {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strength-text.weak { color: #e74c3c; }
.strength-text.fair { color: #f39c12; }
.strength-text.good { color: #3498db; }
.strength-text.strong { color: #27ae60; }

/* Enhanced Google Sign-In */
.google-signin-container {
    padding: 24px 0;
    text-align: center;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.login-separator {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.login-separator div {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

.login-separator span {
    margin: 0 16px;
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modern Links */
.signup-prompt, .login-prompt {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #ecf0f1;
}

.signup-link, .login-link {
    background: none;
    border: none;
    color: #3498db;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    text-decoration: none;
}

.signup-link:hover, .login-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Forgot Password Form */
.forgot-password-form {
    text-align: center;
}

.forgot-password-form .form-group {
    text-align: left;
}

.forgot-description {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Form Container Centering */
.login-form,
.signup-form,
.forgot-password-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.login-form .form-group,
.signup-form .form-group,
.forgot-password-form .form-group {
    width: 100%;
}

/* Center modal footer */
.modal-footer {
    text-align: center;
    margin-top: 20px;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Enhanced Responsive Design */
@media (max-width: 480px) {
    .modal-content {
        padding: 24px 20px;
        width: 95%;
        border-radius: 16px;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .tab-btn {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    #userLoginSubmitBtn,
    #staffLoginSubmitBtn,
    #userSignupSubmitBtn,
    #forgotPasswordSubmitBtn {
        padding: 16px 24px;
        font-size: 15px;
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .modal-content {
        max-width: 450px;
        padding: 32px;
    }
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: buttonSpin 1s linear infinite;
}

@keyframes buttonSpin {
    to { transform: rotate(360deg); }
}

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
} 

/* Tab switching improvements */
#loginTabs, #signupTabs {
    display: flex !important;
    transition: opacity 0.3s ease;
}

#loginTabs.hidden, #signupTabs.hidden {
    display: none !important;
}

/* Ensure proper visibility for tab mode switching */
#signupTabs {
    display: none !important;
}

#signupTabs.show {
    display: flex !important;
}

#loginTabs.hide {
    display: none !important;
}

/* Tab Buttons */
.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 6px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    --tab-width: 50%;
    --tab-offset: 0px;
} 