/* Authentication Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease;
}

/* Dark mode modal backdrop */
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.8);
}

/* Light mode modal backdrop */
[data-theme="light"] .modal {
    background: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    max-width: 450px;
    width: 90%;
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    animation: modalSlideIn 0.3s ease forwards;
    border: 1px solid var(--border-color);
}

/* Dark mode modal */
[data-theme="dark"] .auth-modal {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

/* Light mode modal */
[data-theme="light"] .auth-modal {
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.auth-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.auth-tab:hover {
    color: var(--primary-color);
    background: var(--background-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-form label i {
    color: var(--primary-color);
    width: 16px;
}

.auth-form .form-group input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--background-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Dark mode auth inputs */
[data-theme="dark"] .auth-form .form-group input {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .auth-form .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: var(--surface-color);
}

[data-theme="dark"] .auth-form .form-group input::placeholder {
    color: var(--text-secondary);
}

/* Light mode auth inputs */
[data-theme="light"] .auth-form .form-group input {
    background: white;
    border-color: var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .auth-form .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
}

[data-theme="light"] .auth-form .form-group input::placeholder {
    color: var(--text-secondary);
}

.auth-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Dark mode auth button */
[data-theme="dark"] .auth-btn:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Light mode auth button */
[data-theme="light"] .auth-btn:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

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

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Dark mode close button */
[data-theme="dark"] .close-modal:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Light mode close button */
[data-theme="light"] .close-modal:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .auth-modal {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.25rem;
    }
    
    .auth-form input {
        padding: 0.875rem;
    }
    
    .auth-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

.auth-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.signin-btn {
    background: var(--primary-gradient);
    color: white;
}

.signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.signup-btn {
    background: var(--success-color);
    color: white;
}

.signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.auth-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    text-align: center;
}

.auth-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-info i {
    color: var(--info-color);
}