/* ============================================================
   ELP Volume Calculator — Frontend Styles
   Palette: Teal #17B89A | Dark #0A1A18 | Accent #F4A261
   Font: system-ui stack (no external dependency)
   ============================================================ */

/* ── Reset / Scope ─────────────────────────────────────────── */
.elvc-wrap *,
.elvc-wrap *::before,
.elvc-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.elvc-wrap {
    --teal:       #17B89A;
    --teal-dark:  #0E9E84;
    --teal-light: #e6f7f4;
    --teal-mid:   #b2e4dc;
    --accent:     #F4A261;
    --dark:       #0A1A18;
    --mid:        #2c3e50;
    --text:       #1a2a36;
    --muted:      #6b7f8e;
    --border:     #d4e4e1;
    --bg:         #f7fafa;
    --card-bg:    #ffffff;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.07);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:  0 12px 40px rgba(0,0,0,.15);
    --radius:     10px;
    --radius-sm:  6px;
    --transition: .18s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ── Lang bar ──────────────────────────────────────────────── */
.elvc-lang-bar {
    display: flex;
    gap: 4px;
    padding: 10px 20px 0;
    justify-content: flex-end;
}
.elvc-lang-btn {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--muted);
    cursor: pointer;
    transition: var(--transition);
}
.elvc-lang-btn:hover,
.elvc-lang-btn.is-active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

/* ── Header ────────────────────────────────────────────────── */
.elvc-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    flex-wrap: nowrap;
}
.elvc-title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: 6px;
    color: var(--dark);
}
.elvc-subtitle {
    font-size: 14px;
    color: var(--muted);
    font-weight: 400;
}

/* ── Layout ────────────────────────────────────────────────── */
.elvc-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0;
    min-height: 500px;
}
@media (max-width: 900px) {
    .elvc-layout { grid-template-columns: 1fr; }
}

/* ── Left panel ────────────────────────────────────────────── */
.elvc-panel-left {
    padding: 20px;
    background: var(--bg);
    min-width: 0;
}

/* ── Search ────────────────────────────────────────────────── */
.elvc-search-bar {
    position: relative;
    margin-bottom: 16px;
}
.elvc-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
    z-index: 2;
}
.elvc-search-input {
    width: 100% !important;
    padding: 10px 36px 10px 44px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: var(--card-bg) !important;
    color: var(--text) !important;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none !important;
    box-shadow: none;
}
.elvc-search-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(23,184,154,.12);
}
.elvc-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    line-height: 1;
    display: none;
}
.elvc-search-clear.is-visible { display: block; }

/* ── Category tabs ─────────────────────────────────────────── */
.elvc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}
.elvc-tab {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.elvc-tab:hover {
    border-color: var(--teal);
    color: var(--teal);
}
.elvc-tab.is-active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

/* ── Items grid ────────────────────────────────────────────── */
.elvc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
@media (max-width: 600px) {
    .elvc-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

.elvc-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    position: relative;
}
.elvc-card:hover {
    border-color: var(--teal-mid);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.elvc-card.is-selected {
    border-color: var(--teal);
    background: var(--teal-light);
}
.elvc-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    flex-shrink: 0;
}
.elvc-card-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    line-height: 1.3;
}
.elvc-card-vol {
    font-size: 11px;
    color: var(--muted);
}
.elvc-card-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.elvc-minus,
.elvc-plus {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-weight: 600;
}
.elvc-minus:hover { border-color: #e74c3c; color: #e74c3c; }
.elvc-plus:hover  { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }
.elvc-qty {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--teal-dark);
}

/* Hidden card */
.elvc-card.is-hidden { display: none; }

/* No results */
.elvc-no-results {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.elvc-sidebar {
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
@media (max-width: 900px) {
    .elvc-sidebar { border-left: none; border-top: 1px solid var(--border); }
}
.elvc-sidebar-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 80px;
}
.elvc-sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -.01em;
}
.elvc-count-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.elvc-count-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
}
.elvc-count-label {
    font-size: 13px;
    color: var(--muted);
}

/* Selected list */
.elvc-selected-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.elvc-selected-list::-webkit-scrollbar { width: 4px; }
.elvc-selected-list::-webkit-scrollbar-track { background: transparent; }
.elvc-selected-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.elvc-empty-msg {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    padding: 12px 0;
    line-height: 1.5;
}
.elvc-sel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--teal-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.elvc-sel-emoji { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.elvc-sel-name  { flex: 1; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elvc-sel-qty   { font-weight: 700; color: var(--teal-dark); flex-shrink: 0; }
.elvc-sel-vol   { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.elvc-show-more {
    background: none;
    border: none;
    color: var(--teal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-align: left;
}
.elvc-show-more:hover { text-decoration: underline; }

/* Volume block */
.elvc-volume-block {
    background: linear-gradient(135deg, var(--dark) 0%, var(--mid) 100%);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.elvc-vol-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    opacity: .85;
}
.elvc-vol-row strong {
    font-size: 18px;
    font-weight: 800;
    opacity: 1;
    color: var(--accent);
}
.elvc-wt-row strong {
    font-size: 15px;
    color: #fff;
}

/* Action buttons */
.elvc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.elvc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.elvc-btn-primary {
    background: var(--teal);
    color: #fff;
}
.elvc-btn-primary:hover { background: var(--teal-dark); }
.elvc-btn-secondary {
    background: transparent;
    border: 1.5px solid var(--teal);
    color: var(--teal);
}
.elvc-btn-secondary:hover { background: var(--teal-light); }
.elvc-btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--muted);
}
.elvc-btn-ghost:hover { border-color: #e74c3c; color: #e74c3c; }
.elvc-btn-full { width: 100%; }

/* ── Mobile sticky bar ─────────────────────────────────────── */
.elvc-sticky {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2147483647;
    background: var(--dark);
    color: #fff;
    padding: 10px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.elvc-sticky.is-visible { display: flex; }
@media (min-width: 901px) { .elvc-sticky { display: none !important; } }
/* On mobile: stack vertically, center the button */
@media (max-width: 900px) {
    .elvc-sticky {
        flex-direction: column;
        align-items: center;
        padding: 12px 16px;
        gap: 8px;
    }
    .elvc-sticky .elvc-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
.elvc-sticky-vol {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: center;
}
.elvc-sticky-vol small { font-size: 11px; opacity: .7; }
.elvc-sticky-vol strong { font-size: 18px; font-weight: 800; color: var(--accent); }
.elvc-sticky .elvc-btn { flex-shrink: 0; }

/* ── Modal overlay ─────────────────────────────────────────── */
.elvc-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(13,27,42,.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: elvc-fade-in .2s ease;
}
@keyframes elvc-fade-in { from { opacity: 0; } to { opacity: 1; } }

.elvc-modal {
    background: var(--card-bg);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: elvc-slide-up .25s ease;
}
@keyframes elvc-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.elvc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: var(--transition);
}
.elvc-modal-close:hover { background: #fee; color: #e74c3c; }

.elvc-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: -.02em;
}
.elvc-modal-vol {
    background: var(--teal-light);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 14px;
    color: var(--teal-dark);
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.elvc-modal-vol strong { font-size: 18px; font-weight: 800; }

/* ── Form ──────────────────────────────────────────────────── */
.elvc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 480px) { .elvc-form-grid { grid-template-columns: 1fr; } }

.elvc-field { display: flex; flex-direction: column; gap: 5px; }
.elvc-field-full { grid-column: 1 / -1; }
.elvc-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.elvc-input {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
    font-family: inherit;
}
.elvc-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(23,184,154,.12);
}
.elvc-input.is-error { border-color: #e74c3c; }
textarea.elvc-input { resize: vertical; min-height: 80px; }

.elvc-form-footer { margin-top: 18px; }
.elvc-form-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}
.elvc-form-msg.is-success { background: #e6f7f4; color: var(--teal-dark); }
.elvc-form-msg.is-error   { background: #fef0ef; color: #c0392b; }

/* ── Empty state ───────────────────────────────────────────── */
.elvc-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    grid-column: 1 / -1;
}

/* ── Country select ────────────────────────────────────────── */
.elvc-wrap select.elvc-input,
.elvc-wrap select.elvc-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231E9E87' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Header logo and text sub-elements ──────────────────────────────────────────────── */
.elvc-header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.elvc-header-logo img {
    max-height: 48px;
    max-width: 180px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}
.elvc-header-text {
    flex: 1;
    min-width: 0;
}
.elvc-header-text .elvc-title {
    margin-bottom: 4px;
}
@media (max-width: 600px) {
    .elvc-header { flex-wrap: wrap; gap: 12px; }
    .elvc-header-logo img { max-height: 36px; }
}

/* ── Modal logo ────────────────────────────────────────────── */
.elvc-modal-logo {
    text-align: center;
    margin-bottom: 10px;
}
.elvc-modal-logo img {
    max-height: 44px;
    width: auto;
}

/* ── Modal company footer ──────────────────────────────────── */
.elvc-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    justify-content: center;
    padding: 12px 0 2px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
}
.elvc-modal-footer a {
    color: var(--teal);
    text-decoration: none;
}
.elvc-modal-footer a:hover { text-decoration: underline; }

/* ── Move size estimate bar ─────────────────────────────────────────────────── */
.elvc-move-bar {
    margin: 4px 0;
    padding: 12px 14px;
    background: #f4faf9;
    border-radius: 10px;
    border: 1px solid #d0ece8;
}
.elvc-move-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.elvc-move-bar-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    text-transform: none;
    letter-spacing: 0;
}
.elvc-move-bar-track {
    height: 7px;
    background: #d8eeeb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 5px;
}
.elvc-move-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--teal);
    border-radius: 99px;
    transition: width 0.45s cubic-bezier(.4,0,.2,1), background 0.3s ease;
}
.elvc-move-bar-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9bb8b4;
}

/* ── Custom items section in modal ──────────────────────────────────────────── */
.elvc-custom-items {
    margin: 14px 0 0;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
.elvc-custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.elvc-btn-add-custom {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1.5px solid var(--teal);
    color: var(--teal);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-transform: none;
    letter-spacing: 0;
}
.elvc-btn-add-custom:hover { background: var(--teal); color: #fff; }
.elvc-custom-list { display: flex; flex-direction: column; gap: 7px; }
.elvc-custom-row {
    display: grid;
    grid-template-columns: 1fr 90px 60px 30px;
    gap: 6px;
    align-items: center;
}
@media (max-width: 480px) {
    .elvc-custom-row { grid-template-columns: 1fr 80px 50px 28px; }
}
.elvc-custom-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: #c0392b;
    cursor: pointer;
    border-radius: 5px;
    transition: background var(--transition);
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}
.elvc-custom-remove:hover { background: #fdecea; }

/* ── Turnstile widget ────────────────────────────────────────────────────────── */
.elvc-turnstile-wrap {
    display: flex;
    justify-content: center;
    margin: 12px 0 4px;
}

/* ── Custom item TAB panel ───────────────────────────────────────────────────── */
.elvc-custom-panel {
    padding: 24px 4px 8px;
}
.elvc-custom-panel-desc {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
    line-height: 1.5;
}
.elvc-custom-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 24px;
}
.elvc-custom-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 180px;
}
.elvc-custom-field-sm {
    flex: 0 1 110px;
}
.elvc-custom-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
#elvc-custom-add-btn {
    align-self: flex-end;
    flex-shrink: 0;
    white-space: nowrap;
}
/* Custom tab item list rows */
.elvc-custom-tab-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}
.elvc-ctr-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.elvc-ctr-vol {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.elvc-ctr-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 6px;
}
.elvc-ctr-qty span {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--teal);
}
.elvc-ctr-minus, .elvc-ctr-plus {
    border: none;
    background: transparent;
    color: var(--teal);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color var(--transition);
}
.elvc-ctr-minus:hover, .elvc-ctr-plus:hover { color: var(--teal-dark); }
.elvc-ctr-remove {
    border: none;
    background: transparent;
    color: #c0392b;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: background var(--transition);
}
.elvc-ctr-remove:hover { background: #fdecea; }
@media (max-width: 600px) {
    .elvc-custom-add-form { flex-direction: column; }
    .elvc-custom-field, .elvc-custom-field-sm { flex: 1 1 100%; }
    #elvc-custom-add-btn { width: 100%; }
}
