/**
 * Auth Widget Styles
 */

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Login Button */
.login-btn {
    padding: 10px 20px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: #0f2505;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: #f9fafb;
    border-color: #2d5016;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2d5016;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.user-name {
    color: #333;
    font-size: 15px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    color: #333;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dropdown-item:hover {
    background: #f9fafb;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 5px 0;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.auth-header h2 {
    margin: 0;
    color: #1e3a8a;
    font-size: 28px;
}

.auth-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.auth-close:hover {
    color: #000;
}

.auth-body {
    padding: 30px;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: #e0f2e9;
    border-color: #2d5016;
    color: #2d5016;
    font-weight: 500;
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2d5016;
}

.form-group input.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 5px;
}

/* Submit Buttons */
.submit-auth-btn {
    width: 100%;
    padding: 15px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-auth-btn:hover {
    background: #0f2505;
}

.submit-auth-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Auth Messages */
.auth-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.auth-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Loading State */
.auth-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2d5016;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-loading p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Password Toggle */
.password-toggle {
    position: relative;
}

.password-toggle input {
    padding-right: 45px;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
}

.toggle-password-btn:hover {
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-container {
        gap: 10px;
    }
    
    .login-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .user-menu-btn {
        padding: 6px 12px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .auth-modal-content {
        max-height: 95vh;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .auth-body {
        padding: 20px;
    }
    
    .auth-tab {
        font-size: 14px;
        padding: 10px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input {
        font-size: 14px;
    }
    
    .submit-auth-btn {
        font-size: 15px;
    }
}
