/* style.css - vzhled košíku ("tečkovaný poznámkový blok"), tmavé pozadí
   s teplou rajčatovou červenou jako akcent */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #17181A;
    --surface: #212224;
    --surface-hover: #2A2B2E;
    --border: #38393C;
    --primary: #D4553F;
    --primary-dark: #B8442F;
    --primary-soft: rgba(212, 85, 63, 0.15);
    --accent-gold: #E0A94B;
    --text: #F2EFEA;
    --text-muted: #A6A29B;
    --danger: #E0645A;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--bg);
    background-image: url('dotgrid.png');
    background-repeat: repeat;
    color: var(--text);
    font-family: 'Work Sans', sans-serif;
    line-height: 1.5;
    position: relative;
}

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

h1, h2, h3, .display {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 60px;
    position: relative;
    z-index: 1;
}

/* ---- Horní lišta ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    opacity: 0;
    animation: rise 0.5s ease-out 0.05s forwards;
}
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--text-muted); }

.site-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.site-logo-img { height: 38px; width: auto; display: block; }
.site-logo-text {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #C4479F 0%, #9B6DD6 55%, #5C93C4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #9B6DD6;
}

.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand .app-name {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    padding-left: 12px;
    border-left: 1px solid var(--border);
    opacity: 0.9;
    transition: opacity 0.15s ease;
}
.topbar-brand .app-name:hover { opacity: 1; }

/* ---- Tlačítka ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--surface-hover); border-color: var(--primary); }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #17181A;
    font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-text { background: none; border: none; color: var(--text-muted); padding: 6px 8px; }
.btn-text:hover { background: none; color: var(--text); }

/* ---- Vstupy ---- */
input, select, textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---- Filtr / seznam karet na přehledu ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 28px; }

.pill {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.pill:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.pill.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.recipe-grid, .list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.recipe-card, .list-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    opacity: 0;
    animation: rise 0.45s ease-out forwards;
}
.recipe-card:nth-child(1), .list-card:nth-child(1) { animation-delay: 0.2s; }
.recipe-card:nth-child(2), .list-card:nth-child(2) { animation-delay: 0.26s; }
.recipe-card:nth-child(3), .list-card:nth-child(3) { animation-delay: 0.32s; }
.recipe-card:nth-child(4), .list-card:nth-child(4) { animation-delay: 0.38s; }
.recipe-card:nth-child(5), .list-card:nth-child(5) { animation-delay: 0.44s; }
.recipe-card:nth-child(6), .list-card:nth-child(6) { animation-delay: 0.5s; }
.recipe-card:nth-child(n+7), .list-card:nth-child(n+7) { animation-delay: 0.56s; }

.recipe-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 26px; height: 26px;
    background: linear-gradient(135deg, transparent 50%, var(--bg) 50%);
    border-bottom-left-radius: 4px;
}

.recipe-card::before, .list-card::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(212, 85, 63, 0.06), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}
.recipe-card:hover::before, .list-card:hover::before { left: 130%; }

.recipe-card:hover, .list-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background: var(--surface-hover);
    box-shadow: 0 8px 24px -10px rgba(212, 85, 63, 0.3);
}

.recipe-card h3, .list-card h3 { margin: 0 0 8px; font-size: 1.15rem; padding-right: 20px; }
.recipe-card .meta { display: flex; gap: 14px; font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }
.recipe-card .desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .display { font-size: 1.3rem; color: var(--text); margin-bottom: 8px; }

.hidden { display: none !important; }

@media (max-width: 600px) {
    .topbar { padding: 16px; }
    .container { padding: 0 16px 40px; }
}

@media (max-width: 480px) {
    .topbar-brand .app-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .topbar, .filter-bar, .recipe-card, .list-card { opacity: 1; }
}
