/* ===================================
   GER-VIN - Authentication & User System
   =================================== */

/* User Dropdown Menu (Google-Style) */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.user-avatar:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 320px;
    padding: 1.5rem;
    display: none;
    z-index: 1001;
    animation: dropdownFade 0.3s ease;
}

.user-dropdown.active {
    display: block;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.user-dropdown-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    position: relative;
}

.user-role-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: white;
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-role-badge.admin {
    background: #f44336;
    color: white;
}

.user-role-badge.moderator {
    background: #ff9800;
    color: white;
}

.user-role-badge.user {
    background: #4caf50;
    color: white;
}

.user-dropdown-email {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.user-dropdown-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.user-stat {
    text-align: center;
    padding: 0.75rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.user-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.user-stat-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-dropdown-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    background: transparent;
}

.user-dropdown-btn:hover {
    background: #f5f5f5;
}

.user-dropdown-btn.primary {
    background: var(--primary-color);
    color: white;
}

.user-dropdown-btn.primary:hover {
    background: #b71c1c;
}

.user-dropdown-btn.danger {
    background: #f44336;
    color: white;
}

.user-dropdown-btn.danger:hover {
    background: #d32f2f;
}

/* Login/Register Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 2rem;
}


.auth-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
    padding: 3rem;
    animation: authBoxFade 0.5s ease;
}

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

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-logo p {
    color: #666;
    font-size: 0.9rem;
}

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

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

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-group input.error {
    border-color: #f44336;
}

.form-error {
    color: #f44336;
    font-size: 0.85rem;
    display: none;
}

.form-error.active {
    display: block;
}

.auth-submit {
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.auth-submit:hover {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.auth-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: #666;
    font-size: 0.9rem;
}

.auth-link {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.auth-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Comments Section */
.comments-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    border: 1px solid var(--border-color);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.comments-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.comment-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid #e0e0e0;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.comment-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.comment-btn-primary:hover {
    background: #b71c1c;
}

.comment-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.comment-btn-secondary:hover {
    background: #d0d0d0;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.comment:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.comment-info {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-date {
    font-size: 0.85rem;
    color: #666;
}

.comment-content {
    color: #444;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.comment-action-btn:hover {
    color: var(--primary-color);
}

.comment-action-btn.delete:hover {
    color: #f44336;
}

/* Admin/Moderator Panel */
.admin-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.admin-tab.active {
    background: var(--primary-color);
    color: white;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.user-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-item-actions {
    display: flex;
    gap: 0.5rem;
}

.user-item-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.user-item-btn.ban {
    background: #f44336;
    color: white;
}

.user-item-btn.unban {
    background: #4caf50;
    color: white;
}

.user-item-btn.warn {
    background: #ff9800;
    color: white;
}

/* Recipe Form */
.recipe-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.recipe-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.ingredient-input-group,
.step-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ingredient-input-group input,
.step-input-group textarea {
    flex: 1;
}

.ingredient-input-group button,
.step-input-group button {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.ingredients-list,
.steps-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.ingredients-list li,
.steps-list li {
    background: #f5f5f5;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-item {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.recipe-status-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
}

.recipe-status-badge.pending {
    background-color: #ff9800;
}

.recipe-status-badge.approved {
    background-color: #4caf50;
}

.recipe-status-badge.rejected {
    background-color: #f44336;
}

.recipe-badge.user-recipe {
    background-color: #9c27b0;
}

/* My Recipes Page */
.my-recipes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.recipe-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.recipe-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.recipe-action-btn.edit {
    background: #2196f3;
    color: white;
}

.recipe-action-btn.delete {
    background: #f44336;
    color: white;
}

.recipe-action-btn.approve {
    background: #4caf50;
    color: white;
}

.recipe-action-btn.reject {
    background: #f44336;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .user-dropdown {
        min-width: 280px;
        right: -20px;
    }
    
    .auth-box {
        padding: 2rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
