/* Enhanced Reset Password Modal CSS */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Simple dark overlay instead of blue gradient */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Higher z-index to appear above login modal */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px); /* Reduced blur */
    -webkit-backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    display: flex; /* Ensure it becomes flex when active */
}

/* Modal Container */
.modal-container {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    max-width: 520px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #2a5298 #f1f5f9;
}

/* Custom scrollbar for webkit browsers */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: #2a5298;
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: #1e3c72;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: white;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Body */
.modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(95vh - 120px);
}

/* Reset Tabs */
.reset-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 18px 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2a5298, #1e3c72);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: #2a5298;
    background: white;
}

.tab-btn.active::before {
    transform: scaleX(1);
}

.tab-btn:hover:not(.active) {
    color: #1e3c72;
    background: #f1f5f9;
}

/* Reset Forms */
.reset-form {
    display: none;
    padding: 32px 28px;
    animation: fadeInUp 0.4s ease-out;
}

.reset-form.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-header h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1e3c72;
    font-weight: 700;
}

.form-header p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.5;
}

/* Form Content */
.reset-form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    color: #374151;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
    transform: translateY(-1px);
}

/* Password Input */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 0 0 12px 12px;
    margin: 25px -24px -24px -24px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary::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 ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Ensure buttons are visible and prominent */
.form-actions {
    position: relative;
    z-index: 10;
}

.form-actions .btn {
    min-width: 140px;
    height: 45px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    outline: none;
    position: relative;
    z-index: 11;
}

.form-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-actions .btn:active {
    transform: translateY(0);
}

/* Messages */
.message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInDown 0.3s ease-out;
}

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

.message.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #f87171;
}

.message.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #60a5fa;
}

/* Responsive Design */
@media (max-width: 600px) {
    .modal-container {
        width: 98%;
        max-width: none;
        margin: 10px;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px 24px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .tab-btn {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    .reset-form {
        padding: 24px 20px;
    }
    
    .form-header h3 {
        font-size: 20px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .btn-primary {
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    .modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: none;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .reset-form {
        padding: 20px 16px;
    }
}

/* Loading Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Focus Management */
.modal-overlay:focus-within {
    outline: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-container,
    .reset-form,
    .message,
    .btn-primary,
    .tab-btn {
        transition: none;
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .modal-container {
        border: 2px solid #000;
    }
    
    .form-group input,
    .form-group select {
        border-width: 2px;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}
