/* style.css - vzhled appky 3D kalkulačky (sdílí fialový branding, přidává
   oranžový akcent a honeycomb texturu jako téma "3D tisk") */

@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: #1B1225;
    --surface: #251A35;
    --surface-hover: #2F213F;
    --border: #3A2B4D;
    --primary: #9B6DD6;
    --primary-dark: #7C52B0;
    --primary-soft: rgba(155, 109, 214, 0.15);
    --accent-gold: #E0A94B;
    --accent-orange: #FF7A29;
    --accent-orange-soft: rgba(255, 122, 41, 0.15);
    --text: #F3ECF7;
    --text-muted: #B8A8C9;
    --danger: #E0645A;
    --radius: 10px;
}

* { box-sizing: border-box; }

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

/* Dýchající záře - stejná signatura jako ostatní appky, jen s trochou
   oranžové přimíchané pro odlišení tématu. */
body::before {
    content: '';
    position: fixed;
    top: 15%; left: 50%;
    width: 900px; height: 900px;
    background: radial-gradient(circle, rgba(155, 109, 214, 0.13) 0%, rgba(255, 122, 41, 0.05) 45%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: breathe 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes breathe {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

@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: 720px;
    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;
    position: relative;
    z-index: 1;
    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: var(--primary);
}

.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(--accent-orange);
    padding-left: 12px;
    border-left: 1px solid var(--border);
    opacity: 0.9;
    transition: opacity 0.15s ease;
}
.topbar-brand .app-name:hover { opacity: 1; }

/* ---- Navigační záložky appky (Kalkulačka / Historie / Nastavení) ---- */
.app-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    opacity: 0;
    animation: rise 0.5s ease-out 0.12s forwards;
}
.app-tabs a {
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.app-tabs a:hover { color: var(--text); }
.app-tabs a.active { color: var(--accent-orange); border-bottom-color: var(--accent-orange); }

/* ---- 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(--accent-orange);
    border-color: var(--accent-orange);
    color: #1B1225;
    font-weight: 600;
}
.btn-primary:hover { background: #e56a1f; border-color: #e56a1f; }

.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;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--accent-orange-soft);
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Karta s výsledkem (honeycomb roh jako signatura místo kartotéčního rohu) ---- */
.result-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    margin-top: 24px;
    text-align: center;
    overflow: hidden;
    opacity: 0;
    animation: rise 0.4s ease-out 0.1s forwards;
}
.result-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    background-image: url('honeycomb.png');
    background-size: 60px 34px;
    opacity: 0.5;
    -webkit-mask-image: radial-gradient(circle, black 40%, transparent 75%);
    mask-image: radial-gradient(circle, black 40%, transparent 75%);
}
.result-card .price-label { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 6px; position: relative; }
.result-card .price {
    font-family: 'Fraunces', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-orange);
    position: relative;
}
.result-card .price-breakdown {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
    position: relative;
    flex-wrap: wrap;
}
.result-card .price-breakdown strong { color: var(--text); display: block; font-family: 'Fraunces', serif; font-size: 1rem; }

/* ---- Seznam (materiály, historie) ---- */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    opacity: 0;
    animation: rise 0.35s ease-out forwards;
}
.list-row:nth-child(1) { animation-delay: 0.15s; }
.list-row:nth-child(2) { animation-delay: 0.19s; }
.list-row:nth-child(3) { animation-delay: 0.23s; }
.list-row:nth-child(4) { animation-delay: 0.27s; }
.list-row:nth-child(n+5) { animation-delay: 0.3s; }

.list-row .name { font-weight: 600; }
.list-row .meta { font-size: 0.82rem; color: var(--text-muted); }
.list-row .price-tag { color: var(--accent-orange); font-weight: 600; }
.list-row .remove-btn { background: none; border: none; color: var(--danger); font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }

.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; }
    .row-2 { grid-template-columns: 1fr; }
    .result-card .price { font-size: 2.2rem; }
}

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

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