/* Apple-inspired design aesthetic */

/* System fonts - San Francisco on Mac, fallback to system fonts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light mode colors */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.05);
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --tag-bg: #f5f5f7;
    --tag-hover: #e8e8ed;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #000000;
    --bg-secondary: #1d1d1f;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --tag-bg: #2d2d2f;
    --tag-hover: #3d3d3f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* General link styles - match style guide */
a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

a:visited {
    color: var(--text-primary);
}

/* Navigation - minimal and clean */
.navbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .navbar {
    background-color: rgba(29, 29, 31, 0.8);
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: opacity 0.2s ease, color 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.7;
}

/* Theme toggle button */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--tag-hover);
    transform: scale(1.05);
}

.theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Typography */
h1 {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

h2 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

p {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.lead {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 400;
    transition: color 0.3s ease;
}

/* Cards - Apple style with subtle shadows */
.card {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow-hover);
}

.recipe-card {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow-hover);
}

.recipe-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recipe-card-title:hover {
    opacity: 0.7;
}

.recipe-card-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    transition: color 0.3s ease;
}

/* Grid layout */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Search input - Apple style */
.search-container {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.0625rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

[data-theme="dark"] .search-input:focus {
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--tag-bg);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .tag {
    background: #2d2d2f;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

.tag:hover {
    background: var(--tag-hover);
    transform: scale(1.05);
}

[data-theme="dark"] .tag:hover {
    background: #3d3d3f;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Buttons - Apple style */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #ffffff;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.btn-secondary {
    background: var(--tag-bg);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--tag-hover);
    box-shadow: 0 4px 12px var(--shadow);
}

/* Recipe content */
.recipe-content {
    margin: 2rem 0;
}

.recipe-content h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.recipe-content h2:first-of-type {
    margin-top: 0;
}

.recipe-content ul,
.recipe-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.recipe-content li {
    margin: 0.75rem 0;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1.0625rem;
    transition: color 0.3s ease;
}

.recipe-content p {
    margin: 1.5rem 0;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Links in recipe content - match style guide */
.recipe-content a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--text-secondary);
    text-underline-offset: 0.2em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease, opacity 0.2s ease;
}

.recipe-content a:hover {
    color: var(--text-primary);
    text-decoration-color: var(--text-primary);
    opacity: 0.7;
}

.recipe-content a:visited {
    color: var(--text-primary);
}

/* Recipe images - rounded corners and size limits */
.recipe-content img {
    max-width: 100%;
    height: auto;
    max-height: 600px;
    width: auto;
    border-radius: 18px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-light);
    display: block;
    margin: 2rem auto;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.recipe-content p:has(img) {
    margin: 2rem 0;
    text-align: center;
}

[data-theme="dark"] .recipe-content img {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Alert/Info boxes */
.alert {
    background: var(--tag-bg);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Tag page specific styles */
.tag-link {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s ease, opacity 0.2s ease;
}

.tag-link:hover {
    opacity: 0.7;
}

.tag-count {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    transition: color 0.3s ease;
}

[data-theme="dark"] .tag-count {
    color: #a1a1a6;
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 2rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-version {
    margin-top: 0.5rem;
    color: var(--text-secondary) !important;
}

.footer-version code.version-hash {
    background-color: var(--tag-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.version-date {
    margin-left: 0.25rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 2rem 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .nav-container {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
    }
    
    .nav-links {
        gap: 1.5rem;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .recipe-card {
        padding: 1.5rem;
    }
    
    .recipe-content img {
        max-height: 400px;
        border-radius: 12px;
        margin: 1.5rem auto;
    }
}
