* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables for Light and Dark Mode */
:root {
    --bg-primary: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --bg-secondary: white;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: rgba(0, 0, 0, 0.08);
    --navbar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: linear-gradient(90deg, #667eea, #764ba2);
    --hover-color: #ffd700;
}

/* Dark Mode Variables */
:root.dark-mode {
    --bg-primary: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --bg-secondary: #2d2d2d;
    --text-primary: #f0f0f0;
    --text-secondary: #d0d0d0;
    --text-light: #888;
    --border-color: rgba(255, 255, 255, 0.1);
    --navbar-bg: linear-gradient(135deg, #1e1e2e 0%, #2d1b4e 100%);
    --accent-color: linear-gradient(90deg, #667eea, #764ba2);
    --hover-color: #ffb700;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--navbar-bg);
    padding: 15px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
}

.navbar div {
    display: flex;
    gap: 30px;
    align-items: center;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

/* Logo link - no underline effect */
.navbar a > h1::after {
    display: none;
}

.navbar a:hover {
    color: var(--hover-color);
}

/* Logo link hover - no underline */
.navbar a > h1:hover {
    color: var(--hover-color);
}

.navbar a:not(:has(h1)):hover::after {
    width: 100%;
}

/* Dark mode toggle button */
.theme-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 50%;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Logo link - no underline animation */
.navbar a > h1 {
    transition: all 0.3s ease;
}

.navbar a > h1:hover {
    color: #ffd700;
}


/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.container h1,
.container h2 {
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.container h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Grid for recipes */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 20px;
}


/* Recipe Cards */
.recipe-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

:root.dark-mode .recipe-card {
    border: 1px solid rgba(102, 126, 234, 0.2);
}

:root.dark-mode .recipe-card:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
}

.recipe-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    filter: brightness(1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.recipe-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

:root.dark-mode .recipe-card img {
    filter: brightness(0.92) contrast(1.08) saturate(1.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

:root.dark-mode .recipe-card:hover img {
    filter: brightness(1.02) contrast(1.12) saturate(1.1);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

.recipe-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Subtle gradient overlay on card content for better text contrast */
.recipe-card-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 100%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.recipe-card:hover .recipe-card-content::before {
    height: 100%;
}

.recipe-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.recipe-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 5px 0;
    position: relative;
    z-index: 1;
}

.recipe-card .badge {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    width: fit-content;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.recipe-card:hover .badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

:root.dark-mode .recipe-card .badge {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.recipe-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

/* Forms */
form {
    background: var(--bg-secondary);
    padding: 40px;
    margin: 20px auto;
    width: 100%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

form h2 {
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    margin: 0;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
button {
    background: var(--accent-color);
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--text-secondary);
    color: white;
}
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.4);
}

/* Auth Links */
.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: #764ba2;
}

:root.dark-mode .auth-link a {
    color: #8b9bff;
}

:root.dark-mode .auth-link a:hover {
    color: #b39dff;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #f5576c;
}

.toast.info {
    border-left: 4px solid #667eea;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Search & Filter */
.search-filter {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.filter-select {
    min-width: 200px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .recipe-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .navbar div {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .container {
        width: 95%;
    }
    .navbar h1 {
        font-size: 22px;
    }
    .navbar a {
        font-size: 14px;
    }
    form {
        padding: 30px;
    }
    .search-filter {
        flex-direction: column;
    }
    .search-box,
    .filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }
    .navbar h1 {
        margin-bottom: 15px;
        font-size: 20px;
    }
    .navbar div {
        flex-direction: column;
        gap: 10px;
    }
    .navbar a {
        padding: 10px 0;
    }
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    form {
        width: 90%;
        padding: 20px;
    }
    button {
        padding: 12px 20px;
        font-size: 14px;
    }
}
