/* ============================================================
   SZÉPFIÚK APP – app.css  (light theme)
   ============================================================ */

/* --- Inputs ------------------------------------------------- */
.input, .inp {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding: 0 0.875rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #111827;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-size: .9375rem;
}
.input::placeholder, .inp::placeholder { color: #9ca3af; }
.input:focus, .inp:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea.input, textarea.inp { height: auto; padding: .625rem .875rem; resize: vertical; }
select.input, select.inp { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem; }

/* --- Buttons ------------------------------------------------ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 1.25rem;
    line-height: 1.25;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    font-size: .9375rem;
    transition: background .15s, transform .1s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}
.btn-primary:hover  { background: #1d4ed8; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; pointer-events: none; }

.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 1.25rem;
    line-height: 1.25;
    border-radius: 0.5rem;
    background: #d97706;
    color: #fff;
    font-weight: 600;
    font-size: .9375rem;
    transition: background .15s, transform .1s;
    cursor: pointer;
    border: none;
}
.btn-accent:hover  { background: #b45309; }
.btn-accent:active { transform: scale(.98); }
.btn-accent:disabled { opacity: .55; pointer-events: none; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 1.25rem;
    line-height: 1.25;
    border-radius: 0.5rem;
    background: #dc2626;
    color: #fff;
    font-weight: 600;
    font-size: .9375rem;
    transition: background .15s, transform .1s;
    cursor: pointer;
    border: none;
}
.btn-danger:hover  { background: #b91c1c; }
.btn-danger:active { transform: scale(.98); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 1.25rem;
    line-height: 1.25;
    border-radius: 0.5rem;
    background: #fff;
    color: #374151;
    font-weight: 500;
    font-size: .9375rem;
    border: 1px solid #d1d5db;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}
.btn-outline:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-outline:active { transform: scale(.98); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px .75rem;
    line-height: 1.25;
    border-radius: .375rem;
    background: transparent;
    color: #374151;
    font-size: .8125rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}
.btn-ghost:hover { background: #f3f4f6; }

/* --- Labels ------------------------------------------------- */
.label, .lbl {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .375rem;
    color: #374151;
}
.form-row { display:flex; align-items:center; gap:0.5rem; }
.form-row.align-start { align-items:flex-start; }
.form-row .lbl { width:5.5rem; flex-shrink:0; margin-bottom:0; font-size:.8125rem; }
.form-row.align-start .lbl { padding-top:0.45rem; }
.form-row .inp { flex:1; min-width:0; width:auto !important; }
.file-upload { flex:1; min-width:0; }
.file-upload input[type=file] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.file-upload-btn { display:flex; align-items:center; gap:0.5rem; height:2.75rem; padding:0 0.875rem; border-radius:0.5rem; border:1.5px dashed #d1d5db; background:#f9fafb; color:#6b7280; font-size:.875rem; cursor:pointer; transition:border-color .15s, background .15s; width:100%; }
.file-upload-btn:hover { border-color:#2563eb; background:#eff6ff; color:#2563eb; }
.file-upload-btn svg { flex-shrink:0; }
.file-upload-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* --- Modals ------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
@media (min-width: 640px) {
    .modal-overlay { align-items: center; padding: 1rem; }
}
.modal-box {
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    padding: 1.25rem 1rem 2rem;
    width: 100%;
    max-width: 28rem;
    max-height: 84vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0,0,0,.12);
}
@supports (height: 1dvh) {
    .modal-box { max-height: calc(100dvh - 3.5rem); }
}
@media (min-width: 640px) {
    .modal-box {
        border-radius: 1rem;
        padding: 1.5rem;
        box-shadow: 0 8px 40px rgba(0,0,0,.2);
    }
}
.modal-box.modal-wide { max-width: 36rem; }
.modal-box.modal-fullh {
    height: 84vh;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    padding: .75rem .75rem 1rem;
}
@supports (height: 1dvh) {
    .modal-box.modal-fullh {
        height: calc(100dvh - 3.5rem);
        max-height: calc(100dvh - 3.5rem);
    }
}
@media (min-width: 640px) {
    .modal-box.modal-fullh { padding: 1.5rem; height: 90vh; max-height: 90vh; }
}
.modal-box.modal-fullh .modal-head { flex-shrink: 0; }
.modal-box.modal-fullh .modal-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: .75rem;
}
.modal-head h2 { font-size: 1.125rem; font-weight: 700; color: #111827; }
.modal-head p  { font-size: .8125rem; color: #6b7280; margin-top: .2rem; }
.mclose {
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s;
    padding: .25rem;
    background: none;
    border: none;
    flex-shrink: 0;
}
.mclose:hover { color: #374151; }

/* --- Tabs --------------------------------------------------- */
.tab-bar {
    display: flex;
    gap: .25rem;
    background: #f3f4f6;
    border-radius: .625rem;
    padding: .25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 1 1 auto;
    padding: .5rem 5px;
    font-size: .75rem;
    font-weight: 500;
    color: #6b7280;
    border-radius: .375rem;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    background: none;
    border: none;
    text-align: center;
}
@media (min-width: 400px) {
    .tab-btn { font-size: .8125rem; padding: .5rem 5px; }
}
.tab-btn:hover { color: #374151; background: rgba(0,0,0,.04); }
.tab-btn.active {
    background: #fff;
    color: #111827;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
}
.tab-btn.active-accent {
    background: #fff;
    color: #b45309;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* --- Cards -------------------------------------------------- */
.item-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .875rem;
    overflow: hidden;
}

/* --- Nav-cards (dashboard) ----------------------------------- */
.nav-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    text-decoration: none;
    color: #111827;
    transition: box-shadow .15s, border-color .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.nav-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); border-color: #d1d5db; }

/* --- Menu items (dropdown) ----------------------------------- */
.menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: .625rem 1rem;
    font-size: .875rem;
    color: #374151;
    transition: background .1s;
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: none;
}
.menu-item:hover { background: #f3f4f6; }
.menu-item.danger, .menu-item.text-red-400 { color: #dc2626; }
.menu-item.danger:hover, .menu-item.text-red-400:hover { background: #fef2f2; }
.menu-item:hover { background: rgba(59,110,219,.2); }
.menu-item.danger:hover, .menu-item.text-red-400:hover { background: #fef2f2; }

/* --- Toast -------------------------------------------------- */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
    pointer-events: none;
}
.toast {
    background: #1f2937;
    color: #f9fafb;
    padding: .625rem 1.25rem;
    border-radius: 2rem;
    font-size: .875rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: toastIn .25s ease;
    max-width: 90vw;
    text-align: center;
    pointer-events: auto;
}
.toast.success { background: #166534; }
.toast.error   { background: #991b1b; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Misc --------------------------------------------------- */
.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(255,255,255,.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8125rem;
    flex-shrink: 0;
}

/* Score badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .5rem;
    border-radius: .375rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .8125rem;
    font-weight: 700;
}

/* Winery name (amber) */
.winery-label {
    font-size: .75rem;
    font-weight: 600;
    color: #d97706;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Owner link (blue) */
.owner-label { color: #2563eb; font-size: .8125rem; }

/* Sample card score row */
.score-row {
    display: flex;
    justify-content: space-between;
    font-size: .8125rem;
    padding: .25rem 0;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}
.score-row:last-child { border-bottom: none; }
.score-row .score-val { font-weight: 700; color: #111827; }
.score-row.avg-row { font-weight: 700; color: #111827; border-top: 1px solid #e5e7eb; padding-top: .375rem; margin-top: .125rem; }

/* Inline score input on sample cards */
.sample-score-inp {
    width: 6rem;
    height: 2.25rem;
    border: 1px solid #d1d5db;
    border-radius: .375rem;
    padding: 0 .625rem;
    font-size: .9375rem;
    color: #111827;
    background: #fff;
}
.sample-score-inp:focus { outline: none; border-color: #2563eb; }

/* Image preview */
.img-preview {
    display: block;
    max-height: 300px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
    border-radius: .625rem;
    border: 1px solid #e5e7eb;
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Section header inside modals */
.section-head {
    font-size: .8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    margin: 1rem 0 .5rem;
}

/* Profile modal sub-tabs */
.sub-tab-bar { display:flex; gap:.25rem; background:#f3f4f6; border-radius:.5rem; padding:.25rem; margin-bottom:1rem; }
.sub-tab-btn { flex:1; padding:.5rem; border-radius:.375rem; font-size:.8125rem; font-weight:500; color:#6b7280; background:none; border:none; cursor:pointer; transition:all .15s; text-align:center; }
.sub-tab-btn.active { background:#fff; color:#111827; font-weight:600; box-shadow:0 1px 3px rgba(0,0,0,.1); }

/* Update banner */
#update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #16a34a;
    color: #fff;
    text-align: center;
    padding: .5rem 1rem;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transform: translateY(-100%);
    transition: transform .3s ease;
}
#update-banner.visible {
    transform: translateY(0);
}
