/**
 * 🔐 Modern Auth Modal - Twitter/X Style
 */

/* Modal Overlay */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.auth-modal.show {
    display: flex !important;
}

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

/* Modal Container */
.auth-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    position: relative;
}

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

/* Header */
.auth-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.auth-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Body */
.auth-modal-body {
    padding: 24px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.auth-tab.active {
    color: #1DA1F2;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #1DA1F2;
    border-radius: 2px 2px 0 0;
}

.auth-tab:hover:not(.active) {
    background: #f8f9fa;
    color: #333;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form.hidden {
    display: none;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.form-input {
    padding: 16px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #fafafa;
    color: #333;
}

.form-input:focus {
    outline: none;
    border-color: #1DA1F2;
    background: white;
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #1DA1F2;
    color: white;
}

.btn-primary:hover {
    background: #1a91da;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.btn-google {
    background: white;
    color: #333;
    border: 2px solid #e1e8ed;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #d1d9e0;
}

/* Auth Links */
.auth-links {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.auth-link {
    background: none;
    border: none;
    color: #1DA1F2;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-link:hover {
    color: #1a91da;
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #666;
    font-size: 14px;
}

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

.auth-divider span {
    padding: 0 16px;
    background: white;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error/Success Messages */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.auth-message.error {
    background: #fee;
    color: #d63384;
    border: 1px solid #f5c6cb;
}

.auth-message.success {
    background: #d1edff;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-content {
        width: 95vw;
        margin: 20px;
        border-radius: 16px;
    }
    
    .auth-modal-header {
        padding: 20px 20px 12px;
    }
    
    .auth-modal-body {
        padding: 20px;
    }
    
    .auth-modal-title {
        font-size: 20px;
    }
    
    .form-input {
        padding: 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auth-modal-content {
        background: #15202b;
        color: #e7e9ea;
    }
    
    .auth-modal-header {
        border-bottom-color: #38444d;
    }
    
    .auth-modal-title {
        color: #e7e9ea;
    }
    
    .auth-modal-close {
        color: #8b98a5;
    }
    
    .auth-modal-close:hover {
        background: #38444d;
        color: #e7e9ea;
    }
    
    .auth-tabs {
        border-bottom-color: #38444d;
    }
    
    .auth-tab {
        color: #8b98a5;
    }
    
    .auth-tab.active {
        color: #1DA1F2;
    }
    
    .auth-tab:hover:not(.active) {
        background: #192734;
        color: #e7e9ea;
    }
    
    .form-label {
        color: #e7e9ea;
    }
    
    .form-input {
        background: #192734;
        border-color: #38444d;
        color: #e7e9ea;
    }
    
    .form-input:focus {
        background: #192734;
        border-color: #1DA1F2;
    }
    
    .form-input::placeholder {
        color: #8b98a5;
    }
    
    .btn-google {
        background: #192734;
        color: #e7e9ea;
        border-color: #38444d;
    }
    
    .btn-google:hover {
        background: #38444d;
        border-color: #8b98a5;
    }
    
    .auth-divider {
        color: #8b98a5;
    }
    
    .auth-divider::before,
    .auth-divider::after {
        background: #38444d;
    }
    
    .auth-divider span {
        background: #15202b;
    }
}