/* ============================================
   Custom Modal for Login/Register/Forget Password
   Replaces Bootstrap Modal - matches new design theme
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(-30px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-dialog {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #C6C5D4);
}

.modal-header h5 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark, #14213B);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light, #757575);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-light, #F5F2FB);
    color: var(--text-dark, #14213B);
}

.modal-body {
    padding: 24px;
}

/* Tabs */
.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--bg-light, #F5F2FB);
}

.modal-tab {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light, #757575);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.modal-tab.active {
    color: var(--primary, #1A237E);
    border-bottom-color: var(--secondary, #FB6D00);
}

.modal-tab:hover {
    color: var(--text-dark, #14213B);
}

/* Tab content */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Form styles inside modal */
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #C6C5D4);
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s ease;
    background: var(--bg-white, #FBF8FF);
}

.modal-form input:focus {
    border-color: var(--primary, #1A237E);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.modal-form .g-recaptcha {
    margin-bottom: 16px;
}

.modal-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--secondary, #FB6D00);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-submit-btn:hover {
    background: #e65100;
}

.modal-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Google login divider */
.modal-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.modal-divider span {
    color: #999;
    font-size: 13px;
    font-weight: 600;
}

/* Google login button */
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
    background: #fff;
}

.google-login-btn:hover {
    background: #f8f9fa;
}

.google-login-btn svg {
    flex-shrink: 0;
}

/* Scroll to top button */
.scroll-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    background: var(--secondary, #FB6D00);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-btn:hover {
    background: var(--primary, #1A237E);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        margin: 10px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-tab {
        font-size: 13px;
        padding: 10px 4px;
    }
}
