/* ===================================
   User Authentication System
   =================================== */

/* Login Button */
.btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-login:hover {
    background: #ff4569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.4);
}

.btn-login i {
    font-size: 16px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    width: 44px;
    height: 44px;
}

.user-avatar-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: scale(1.05);
}

.user-avatar-btn img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    display: none;
    /* Hide username in header */
}

.user-avatar-btn i {
    display: none;
    /* Hide chevron icon */
}

.user-dropdown.active .user-avatar-btn i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.dropdown-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.dropdown-name {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

.dropdown-email {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.dropdown-item i {
    width: 20px;
    font-size: 16px;
}

.dropdown-item.logout {
    color: #ff4444;
}

.dropdown-item.logout:hover {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

/* Auth Pages Container */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-hover);
}

.form-group small {
    font-size: 12px;
    color: var(--text-muted);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.link:hover {
    color: var(--accent);
}

.link-accent {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.link-accent:hover {
    text-decoration: underline;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #ff4569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert i {
    font-size: 18px;
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

/* Profile Page */
.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.profile-email {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.profile-joined {
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.profile-nav {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.profile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.profile-nav-link:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}

.profile-nav-link.active {
    background: var(--bg-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}

.profile-nav-link.logout {
    color: #ff4444;
}

.profile-nav-link i {
    width: 20px;
}

.profile-content {
    flex: 1;
}

.profile-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.profile-section h2 {
    font-size: 22px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-upload img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.avatar-upload input[type="file"] {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }

    .profile-container {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 30px 20px;
    }
}