/* Profile Page Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Profile Header */
.profile-header {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.profile-cover {
    height: 200px;
    overflow: hidden;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    position: relative;
    padding: 2rem;
    background: white;
    display: flex;
    align-items: flex-end;
    gap: 2rem;
}

.profile-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    margin-top: -75px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.edit-avatar-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.profile-details {
    flex: 1;
}

.profile-details h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: var(--dark);
}

.profile-details p {
    margin: 0 0 1rem 0;
    color: var(--gray);
}

.profile-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat span:first-child {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.stat span:last-child {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Profile Navigation */
.profile-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 1rem;
    overflow-x: auto;
}

.nav-item {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* Tab Content */
.tab-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.recipes-dashboard {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.recipes-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.recipe-insight-card {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid var(--gray-light);
    background: rgba(255,255,255,0.78);
}

.recipe-insight-card strong {
    display: block;
    font-size: 1.8rem;
    color: var(--primary);
}

.recipe-insight-card span {
    color: var(--gray);
    font-size: 0.9rem;
}

.recipes-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.recipes-bulk-bar > * {
    flex: 0 0 auto;
}

.recipe-select-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.recipe-select-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.88rem;
}

.recipe-analytics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.6rem 0 0.8rem 0;
}

.recipe-analytics-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    color: var(--dark);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Add styles for the recipes container to ensure proper grid layout */
.recipes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-top: 1rem;
}

/* Make sure the recipe cards have consistent sizing */
.recipe-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    border: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 350px;
    margin: 0 auto;
    width: 100%;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Add a min-height to recipe cards to ensure consistent layout */
.recipe-image {
    position: relative;
    height: 200px;
    background: var(--gray-light);
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.recipe-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.saved-date, .viewed-date {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 1rem;
    display: block;
}

.btn-outline {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid var(--primary);
    transition: all 0.3s ease;
    text-align: center;
}

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

.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Comments and Ratings */
.comment-item, .rating-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-light);
    transition: transform 0.3s ease;
}

.comment-item:hover, .rating-item:hover {
    transform: translateY(-5px);
}

/* Loading, empty state and error styles */
.loading, .empty-state, .error-state {
    padding: 3rem;
    text-align: center;
    font-size: 1.1rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.loading {
    color: var(--gray);
    background: rgba(var(--primary-rgb), 0.05);
}

.empty-state {
    color: var(--gray);
    background: rgba(var(--gray-rgb), 0.05);
}

.error-state {
    color: var(--danger);
    background: rgba(var(--danger-rgb), 0.05);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.comment-recipe-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.comment-info h4 {
    margin: 0;
    color: var(--text-color);
}

.comment-date {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.comment-text {
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

.view-recipe-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.view-recipe-link:hover {
    text-decoration: underline;
}

/* Settings Forms */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h2 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-background);
    color: var(--text-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-color-dark);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-color-secondary);
    background: var(--card-background);
    border-radius: 12px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-left: 4px solid;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-color: var(--success, #28a745);
}

.notification.error {
    border-color: var(--danger, #d9534f);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 1.25rem;
}

.notification.success i {
    color: var(--success, #28a745);
}

.notification.error i {
    color: var(--danger, #d9534f);
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-container {
        padding: 1rem;
    }
    
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }
    
    .profile-avatar {
        margin-top: -50px;
    }
    
    .profile-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .profile-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .recipes-grid, .recipes-container {
        grid-template-columns: 1fr;
    }
    
    .recipe-card {
        max-width: 100%;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .recipes-grid, .recipes-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .recipes-grid, .recipes-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Add styles for the meal plan section */
.meal-plans-container {
    width: 100%;
}

.meal-plans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.meal-plan-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.meal-plan-header {
    padding: 1rem;
    background-color: var(--primary-light);
    color: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-plan-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.meal-plan-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background-color: var(--primary);
    color: var(--white);
    border: none;
}

.btn-small.btn-danger {
    background-color: var(--danger);
}

.meal-plan-content {
    padding: 1rem;
}

.meal-section {
    margin-bottom: 1rem;
}

.meal-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--gray);
}

.meal-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meal-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--gray-light);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.meal-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.empty-meal {
    font-style: italic;
    color: var(--gray);
}

/* Rating styles */
.ratings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rating-item {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rating-recipe {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.rating-recipe img {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.rating-recipe-details h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.rating-recipe-details p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gray);
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
    color: #FFD700;
    margin: 0 1.5rem;
}

/* Viewing history styles */
.viewed-date {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0.25rem 0 0.75rem 0;
}

/* Common loading and empty states */
.loading, .empty-state, .error-state {
    padding: 2rem;
    text-align: center;
    border-radius: var(--border-radius);
}

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

.empty-state {
    background-color: var(--gray-light);
    color: var(--gray);
    font-style: italic;
}

.error-state {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Make the profile tabs responsive */
@media (max-width: 768px) {
    .profile-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-item {
        flex-basis: calc(50% - 0.25rem);
        text-align: center;
    }
    
    .meal-plan-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rating-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .rating-stars {
        margin: 0;
    }
}

/* Enhanced App Header Styles */
.app-header {
    background-color: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.5rem;
}

.logo img {
    height: 40px;
    margin-right: 0.75rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

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

.theme-toggle, .user-menu-toggle {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle:hover, .user-menu-toggle:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    transform: translateY(-2px);
}

.user-menu {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    width: 220px;
    padding: 1rem 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-light);
}

.user-menu-dropdown.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    padding: 0 1rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    border: 2px solid var(--primary-light);
}

.user-menu-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-menu-dropdown ul li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-menu-dropdown ul li a:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

.user-menu-dropdown ul li a i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Enhanced App Footer Styles */
.app-footer {
    background-color: var(--primary);
    color: white;
    padding: 3rem 0 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.footer-section h3 {
    margin: 0 0 1.5rem 0;
    color: white;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--secondary);
}

.footer-section p {
    margin: 0 0 1rem 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-section ul li a:hover {
    color: white;
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--secondary);
    transform: translateY(-5px);
}

.footer-bottom {
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Media queries for responsive design */
@media (max-width: 1024px) {
    .header-content, .footer-content {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Recipe actions and buttons */
.recipe-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    flex-wrap: wrap;
}

.recipe-actions > * {
    flex: 1 1 120px;
}

.recipe-state-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.recipe-state-badge.published {
    background: rgba(40, 167, 69, 0.14);
    color: #1f7d35;
}

.recipe-state-badge.draft {
    background: rgba(217, 154, 29, 0.16);
    color: #9a6500;
}

.btn-delete-history {
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid var(--danger, #dc3545);
    color: var(--danger, #dc3545);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-delete-history:hover {
    background-color: var(--danger, #dc3545);
    color: white;
}

.btn-delete-history:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-danger {
    background-color: var(--danger, #dc3545);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #bd2130;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

/* Add styles for viewing history buttons and headers */
.viewed-recipes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
    width: 100%;
}

.viewed-recipes-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.25rem;
}

#clear-history-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

/* Set up the grid layout for the viewed recipes */
#viewed-recipes-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

/* Recipes container grid layout */
.recipes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default: 3 columns */
    gap: 2rem;
    width: 100%;
}

/* Make recipe cards have consistent sizing */
.recipe-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    border: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Responsive design adjustments */
@media (max-width: 1200px) {
    .recipes-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
}

@media (max-width: 768px) {
    .recipes-container {
        grid-template-columns: 1fr; /* 1 column on small screens */
    }
    
    .viewed-recipes-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    #clear-history-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Comment editing styles */
.comment-edit-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 10px;
    min-height: 80px;
    resize: vertical;
}

.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.comment-buttons {
    display: flex;
    gap: 8px;
}

.comment-buttons button {
    padding: 5px 8px;
    font-size: 0.8rem;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #c82333;
}

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

.btn-primary:hover {
    background-color: #0069d9;
}

/* Animation for removing comments */
.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

/* Recipe unavailable message */
.recipe-unavailable {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 4px;
    font-style: italic;
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
}

/* Style for disabled View Recipe link */
.view-recipe-link[style*="opacity"] {
    cursor: not-allowed;
} 

/* Responsive cleanup overrides */
.profile-container {
    padding: calc(var(--header-height) + 1.75rem) 1rem 3rem;
}

.profile-info,
.profile-details,
.tab-content,
.recipe-card,
.recipes-container,
.recipes-grid {
    min-width: 0;
}

.profile-details h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    overflow-wrap: anywhere;
}

.profile-stats {
    flex-wrap: wrap;
}

.recipes-grid,
.recipes-container {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.meal-plan-header,
.meal-plan-actions,
.rating-item {
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .profile-container {
        padding-top: calc(var(--header-height) + 1.25rem);
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .recipes-bulk-bar > * {
        flex: 1 1 100%;
    }

    .recipe-select-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .meal-plan-actions .btn-small,
    .nav-item {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
        text-align: center;
    }
}
