/* Domestic God - Dark Mode Design */

/* 
 * Typography: Using Inter for a clean, modern feel.
 * Falls back to system fonts if unavailable.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-card: #2a2a2a;
    --bg-card-reference: #2a2a2f;
    --text-primary: #f5f5f5;
    --text-secondary: #a8a8a8;
    --text-muted: #707070;
    --accent: #e67e22;
    --accent-hover: #f39c12;
    --accent-secondary: #3498db;
    --accent-reference: #9b59b6;
    --border: #3a3a3a;
    --border-light: #444;
    --gradient-warm: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    --gradient-cool: linear-gradient(135deg, #9b59b6 0%, #3498db 100%);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    position: relative;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.logo-link {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.logo-link:active {
    transform: scale(0.98);
}

.logo {
    height: 64px;
    width: auto;
    max-width: 280px;
    display: block;
}

.tagline {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: lowercase;
    font-weight: 400;
    opacity: 0.9;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 1.5rem;
    margin-bottom: 2.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.35;
    border: none;
    padding: 0;
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 1.5rem auto;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-icon {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    border: none;
}

.section-icon {
    font-size: 1.5rem;
}

.section-description {
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-primary);
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

p {
    margin: 0 0 1rem 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Recipe Cards (Index Page) */
.recipe-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.recipe-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.recipe-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Reference Card Styling */
.card-reference {
    background: var(--bg-card-reference);
    border-left: 3px solid var(--accent-reference);
}

.card-reference:hover {
    border-color: var(--accent-reference);
    border-left-color: var(--accent-reference);
}

.card-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-reference);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

/* Recipe Card Styling */
.card-recipe {
    border-left: 3px solid var(--accent);
}

.card-recipe:hover {
    border-left-color: var(--accent);
}

.recipe-card h3 {
    margin-bottom: 0.75rem;
    padding-right: 4rem;
}

.recipe-card h3 a {
    color: var(--text-primary);
    font-size: 1.15rem;
}

.recipe-card h3 a:hover {
    color: var(--accent);
}

.card-reference h3 a:hover {
    color: var(--accent-reference);
}

.recipe-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Tags */
.meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tag-type {
    background: rgba(230, 126, 34, 0.15);
    border-color: rgba(230, 126, 34, 0.3);
    color: var(--accent);
}

/* Recipe Full Page */
.recipe-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.recipe-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.recipe-header h2 {
    border: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.recipe-section {
    margin-bottom: 2.5rem;
}

.recipe-section h3 {
    color: var(--accent);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Ingredients */
.ingredients-list {
    display: flex;
    flex-direction: column;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-item .name strong {
    color: var(--accent);
    font-weight: 600;
}

.ingredient-item small {
    color: var(--text-muted);
}

/* Steps */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
    min-width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0;
}

.step-content small {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Matrix Table */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.matrix-table th,
.matrix-table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.matrix-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.matrix-table td {
    background: var(--bg-card);
}

.matrix-table tbody tr:hover td {
    background: var(--bg-secondary);
}

.matrix-table td:first-child {
    font-weight: 600;
    color: var(--accent);
}

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--text-secondary);
}

footer a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-features {
        gap: 1rem;
    }
    
    .feature {
        font-size: 0.85rem;
    }
    
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    header {
        padding: 1.25rem 0;
        margin-bottom: 1.5rem;
    }
    
    .header-content {
        padding: 0 1rem;
        gap: 0.6rem;
    }
    
    .logo {
        height: 48px;
        max-width: 200px;
    }
    
    .tagline {
        font-size: 0.75rem;
        letter-spacing: 0.04em;
    }
    
    .hero {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 10px;
    }
    
    .hero-title {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .recipe-full {
        padding: 1.25rem;
        border-radius: 10px;
    }
    
    .recipe-header h2 {
        font-size: 1.3rem;
    }
    
    .matrix-table {
        font-size: 0.85rem;
    }
    
    .matrix-table th,
    .matrix-table td {
        padding: 0.5rem;
    }
    
    .card-type-badge {
        position: static;
        display: inline-block;
        margin-bottom: 0.75rem;
    }
    
    .recipe-card h3 {
        padding-right: 0;
    }
}

/* ==========================================
   SHARE BUTTONS
   ========================================== */

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.share-btn svg {
    flex-shrink: 0;
}

/* Platform-specific colors on hover */
.share-pinterest:hover {
    background: #E60023;
    border-color: #E60023;
    color: white;
}

.share-twitter:hover {
    background: #000;
    border-color: #000;
    color: white;
}

.share-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
    color: white;
}

.share-copy:hover,
.share-copy.copied {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.share-print:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
}

.share-email:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Mobile share buttons */
@media (max-width: 600px) {
    .share-buttons {
        justify-content: center;
    }
    
    .share-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .share-btn span {
        display: none;
    }
    
    .share-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================
   PWA INSTALL BANNER
   ========================================== */

.install-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

.install-banner.visible {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-banner-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.install-banner-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.install-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.install-banner-message {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.install-banner-message small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.install-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.install-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

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

.install-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.install-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

/* iOS-specific instructions */
.ios-instructions {
    display: none;
}

.install-banner.ios .ios-instructions {
    display: block;
}

.install-banner.ios .install-btn-primary {
    display: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .install-banner {
        padding: 1rem;
    }
    
    .install-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .install-banner-text {
        flex-direction: column;
        text-align: center;
    }
    
    .install-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .install-btn {
        flex: 1;
        max-width: 150px;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    /* Reset colors for print */
    :root {
        --bg-primary: white;
        --bg-secondary: white;
        --bg-card: white;
        --text-primary: black;
        --text-secondary: #333;
        --text-muted: #666;
        --accent: #c65a00;
        --border: #ddd;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    /* Hide non-essential elements */
    header,
    footer,
    .share-buttons,
    .meta-tags .tag-type {
        display: none !important;
    }
    
    /* Recipe container - remove shadows and borders */
    .recipe-full {
        border: none;
        box-shadow: none;
        padding: 0;
        background: white;
    }
    
    .recipe-header {
        border-bottom: 2px solid black;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .recipe-header h2 {
        font-size: 18pt;
        margin-bottom: 0.5rem;
    }
    
    /* Tags styling for print */
    .meta-tags {
        margin-bottom: 0.5rem;
    }
    
    .tag {
        background: none;
        border: 1px solid #999;
        padding: 0.15rem 0.5rem;
        font-size: 9pt;
    }
    
    /* Recipe sections */
    .recipe-section {
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    .recipe-section h3 {
        font-size: 12pt;
        border-bottom: 1px solid #999;
        padding-bottom: 0.25rem;
        margin-bottom: 0.5rem;
        color: black;
    }
    
    /* Ingredients - compact for print */
    .ingredient-item {
        padding: 0.25rem 0;
        border-bottom: 1px dotted #ccc;
    }
    
    .ingredient-item .name strong {
        color: black;
    }
    
    /* Steps - compact numbering */
    .step-item {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .step-number {
        background: black;
        color: white;
        min-width: 1.5rem;
        height: 1.5rem;
        font-size: 10pt;
    }
    
    .step-content small {
        background: #eee;
        color: #333;
    }
    
    /* Matrix table for print */
    .matrix-table {
        font-size: 10pt;
    }
    
    .matrix-table th {
        background: #eee;
        color: black;
    }
    
    .matrix-table td {
        background: white;
    }
    
    /* Page break controls */
    .recipe-full {
        page-break-before: avoid;
    }
    
    .ingredients-list,
    .steps-list {
        page-break-inside: avoid;
    }
    
    /* Links - show URL for print */
    a[href]:after {
        content: none; /* Don't show URLs inline */
    }
    
    /* Ensure good contrast */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
