/**
 * Auth UI Styles
 */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    backdrop-filter: blur(5px);
}

.auth-modal.active {
    display: flex;
}

.auth-content {
    background: white;
    border-radius: 25px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.auth-title {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 10px;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.auth-form {
    margin-bottom: 25px;
}

.auth-input-group {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.auth-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.auth-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input.error {
    border-color: #ef4444;
}

.auth-error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.auth-btn-secondary:hover {
    background: #e5e7eb;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 0.9rem;
}

.auth-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.auth-info-title {
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.auth-info-text {
    color: #1e40af;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-info-list {
    margin: 10px 0 0 20px;
    color: #1e40af;
    font-size: 0.9rem;
}

/* Header Container - Chứa Dashboard và User Badge */
.header-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 1000;
}

.header-container.show {
    display: flex;
}

/* Dashboard Button */
.dashboard-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    height: 45px;
}

.dashboard-btn:hover {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.dashboard-icon {
    font-size: 1.3rem;
}

.dashboard-text {
    font-weight: 600;
}

/* User Badge with Dropdown */
.user-badge {
    position: relative;
}

.user-badge-trigger {
    background: white;
    padding: 5px 18px 5px 5px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 45px;
}

.user-badge-trigger:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.user-badge-avatar {
    font-size: 1.8rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
}

.user-badge-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.user-badge-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-badge-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    text-align: left;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.logout-item {
    color: #dc2626;
    border-top: 1px solid #f3f4f6;
}

.dropdown-item.logout-item:hover {
    background: #fee2e2;
}

.dropdown-icon {
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-content {
        padding: 30px 20px;
        width: 95%;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-icon {
        font-size: 3rem;
    }

    .header-container {
        top: 10px;
        right: 10px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-end;
    }

    .dashboard-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .dashboard-text {
        display: none;
    }

    .dashboard-icon {
        font-size: 1.5rem;
    }

    .user-badge {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Avatar Selector Modal */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.avatar-modal-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.avatar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.avatar-modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #4c1d95;
    margin: 0;
}

.avatar-modal-close {
    background: #f3f4f6;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.avatar-modal-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.avatar-option {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.avatar-option:active {
    transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
    .avatar-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }
    
    .avatar-option {
        padding: 12px;
        font-size: 28px;
    }
}
