/* ============================================================
   PREMIUM DARK THEME – RENSAD OCH STABILISERAD
============================================================ */

.hidden-field {
    display: none !important;
}

/* Theme switching - reduce flicker */
html.theme-switching {
    opacity: 0 !important;
    transition: opacity 0.15s ease;
}
html.theme-switching * {
    transition: none !important;
}

:root{
    --ui-scale: 1;
    --bg-main:#05060a;
    --bg-elevated:#10121a;
    --bg-card:#141824;
    --accent:#4da3ff;
    --accent-soft:rgba(77,163,255,0.18);
    --accent-warm:#ffb45c;
    --text-main:#f5f7ff;
    --text-muted:#9aa0b5;
    --border-subtle:#262a3a;
    --radius-card:14px;
    --shadow-soft:0 18px 45px rgba(0,0,0,0.65);
    --transition-fast:0.18s ease-out;
    --transition-med:0.28s ease-out;
    /* Diagram-färger för mörkt tema */
    --chart-text:#f5f7ff;
    --chart-grid:#475569;
    --ucoin-color:#ffb45c;
    --silver-color:#4da3ff;
}
*{ box-sizing:border-box; caret-color: #ffffff; }
body{
    margin:0;
    padding:0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: calc(16px * var(--ui-scale));
    background:
        radial-gradient(circle at top left, #1b2740 0, transparent 55%),
        radial-gradient(circle at bottom right, #1b2030 0, transparent 55%),
        var(--bg-main);
    color:var(--text-main);
    line-height:1.6;
    caret-color: #ffffff;
    transition: opacity 0.5s ease-in-out;
    min-height:100vh;
}
body.fade-out {
    opacity: 0;
}
/* ============================================================
   HEADER + NAVIGATION
============================================================ */
header{
    position:sticky;
    top:0;
    z-index:20;
    padding:14px 20px;
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
    background:linear-gradient(to bottom, rgba(5,6,10,0.96), rgba(5,6,10,0.82));
    border-bottom:1px solid rgba(255,255,255,0.04);
    display:flex;
    align-items:center;
    justify-content:space-between;
}
header nav { flex: 1; }
nav{
    display:flex;
    gap:8px;
    position: relative;
}
nav button{
    background:transparent;
    color:var(--text-muted);
    border:1px solid transparent;
    padding:8px 14px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    letter-spacing:0.03em;
    text-transform:uppercase;
    transition:var(--transition-fast);
}
nav button:hover{
    background:rgba(255,255,255,0.03);
    color:var(--text-main);
    border-color:rgba(255,255,255,0.06);
    transform:translateY(-1px);
}
/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.dropbtn{
    background:transparent;
    color:var(--text-muted);
    border:1px solid transparent;
    padding:8px 14px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    letter-spacing:0.03em;
    text-transform:uppercase;
    transition:var(--transition-fast);
}
.dropbtn:hover{
    background:rgba(255,255,255,0.03);
    color:var(--text-main);
}
.dropdown-content {
    line-height: 1.2 !important;
    display:none;
    position:absolute;
    background:var(--bg-card);
    min-width:200px;
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
    border-radius:8px;
    z-index:50;
    padding:0;
}
.dropdown-content a{
    color:var(--text-main);
    padding:10px 16px;
    text-decoration:none;
    display:block;
    font-size:13px;
    cursor:pointer;
    line-height: 1.2 !important;
}
.dropdown-content a:hover{
    background:rgba(255,255,255,0.05);
}
.dropdown:hover .dropdown-content{
    display:block;
}
#appTitle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 18px;
    /* Metallisk vit glans */
    background: linear-gradient(180deg, #ffffff 0%, #dcdcdc 40%, #f8f8f8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Subtil premiumglow */
    text-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 12px rgba(255,255,255,0.18);
    opacity: 0;
    animation: fadeInTitle 0.8s ease forwards;
    pointer-events: none;
}
#viewForm {
    position: relative;
    z-index: 9999 !important;
}
@keyframes fadeInTitle {
    to { opacity: 1; }
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  color: #dfe4ef;
  text-decoration: none;
  line-height: 1.2 !important;
}
.menu-text {
  font-size: 14px;
  color: #dfe4ef;
}
.menu-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  margin-left: 8px;
}
.menu-icon.market-icon {
  width: 14px;
  height: 14px;
}
/* === PREMIUM INPUT BASE – MER METALLISK LYSTER === */
#searchInput,
#silverPriceInput {
    background: rgba(10,12,20,0.9);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow:
        0 0 12px rgba(220,230,255,0.25),
        0 0 24px rgba(220,230,255,0.15);
    transition: 0.25s ease;
}

/* === HOVER – TYDLIGARE CHROME-SHINE === */
#searchInput:hover,
#silverPriceInput:hover {
    background: rgba(12,14,22,0.95);
    border-color: rgba(255,255,255,0.25);
    box-shadow:
        0 0 16px rgba(235,242,255,0.35),
        0 0 32px rgba(235,242,255,0.20);
    transform: translateY(-1px);
}

/* === FOCUS – MER DEFINIERAD METALLRING + INRE GLOW === */
#searchInput:focus,
#silverPriceInput:focus {
    background: rgba(14,16,24,0.98);
    border-color: rgba(235,242,255,0.70);
    box-shadow:
        0 0 0 2px rgba(235,242,255,0.40),
        0 0 20px rgba(235,242,255,0.45),
        0 0 40px rgba(235,242,255,0.25);
    color: var(--text-main);
}

/* === PREMIUM PLACEHOLDER – LJUSARE SILVERVIT === */
#searchInput::placeholder,
#silverPriceInput::placeholder {
    color: rgba(255,255,255,0.55); /* lite ljusare silvervit */
    transition: 0.25s ease;
}

/* Vid fokus – ännu renare och mer polerad ton */
#searchInput:focus::placeholder,
#silverPriceInput:focus::placeholder {
    color: rgba(255,255,255,0.68);
}

/* ============================================================
   SEARCH + HEADER CONTROLS
============================================================ */
header .rightControls{
    margin-left:auto;
    display:flex;
    gap:10px;
    align-items:center;
}
#searchInput,#silverPriceInput{
    padding:8px 12px;
    border-radius:999px;
    color:var(--text-main);
    font-size:13px;
    outline:none;
    min-width:140px;
    transition:var(--transition-fast);
}
#searchInput{ width:170px; }
#silverPriceInput{ width:140px; }
/* Premium sökfält – isolerad klass */
.vc-search {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 24px 0;
}
.vc-search input[type="text"] {
  width: 70%;
  padding: 10px 14px;
  background: #111;
  color: #eee;
  border: 1px solid rgba(200, 200, 200, 0.35);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.05);
}
.vc-search input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}
#searchResults {
    max-height: 70vh;
    overflow-y: auto;
    min-height: 0;
}
.searchRow {
    padding: calc(18px * var(--ui-scale)) calc(20px * var(--ui-scale));
    border-radius: 8px;
}
/* Premium kort scroll */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #111;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #777, #aaa);
    border-radius: 4px;
    border: 1px solid #222;
    min-height: 30px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #999, #ccc);
}
.compactRow-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}
.compactThumb {
    width: 60px !important;
    height: 60px !important;
    flex: 0 0 62px !important;
    object-fit: cover;
    border-radius: 6px;
}
.compactInfo strong {
    font-size: 15px;
    line-height: 1.25;
}
.compactInfo span {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.2;
}
/* --- Notisblock för förvaringsplats (premiumren version) --- */
.storage-note-block {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 32px;
    animation: fadeIn 0.25s ease-out;
}
.storage-note-title {
    font-size: 13px;
    color: rgba(250, 252, 255, 0.88);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}
.storage-note-input {
    width: 100%;
    min-height: 100px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 6px rgba(255,255,255,0.05),
                0 0 6px rgba(255,255,255,0.10);
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.storage-note-input:focus {
    border-color: rgba(220, 230, 255, 0.35);
    box-shadow:
        inset 0 0 6px rgba(220, 230, 255, 0.18),
        0 0 5px rgba(220, 230, 255, 0.20);
}
.storage-note-input::placeholder {
    color: rgba(240, 245, 255, 0.55);
}
/* --- Platser (kapacitet / använda) --- */
.storage-slots-card {
    margin-bottom: 24px;
}
.storage-slots-hint {
    text-align: center;
    margin: 0 auto 14px;
    max-width: 520px;
    line-height: 1.45;
}
.storage-slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 14px;
}
@media (max-width: 520px) {
    .storage-slots-grid {
        grid-template-columns: 1fr;
    }
}
.storage-slot-field label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-align: center;
}
.storage-slots-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.storage-slots-input:focus {
    outline: none;
    border-color: rgba(220, 230, 255, 0.42);
    box-shadow: 0 0 0 2px rgba(220, 230, 255, 0.12);
}
.storage-slots-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.storage-slots-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.22));
    transition: width 0.35s ease;
}
.storage-slots-fill--warn,
.storage-box-slots-fill--warn {
    background: linear-gradient(90deg, #c45c4a, #e08a6a);
}
.storage-box-slots {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.storage-box-slots-meta {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    opacity: 0.92;
}
.storage-box-slots-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.storage-box-slots-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.18));
    transition: width 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.imageRow {
    display: flex;
    gap: 12px;
    align-items: center;
}
/* ============================================================
   TAGGAR
============================================================ */
.tagContainer {
    margin-top: 12px;
    margin-bottom: 8px;
}
.tagChip {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    padding: 4px 10px;
    margin: 3px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--text-main);
}
.tagFilterWrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}
.tagFilterLabel {
    font-size: 14px;
    color: var(--text-main);
    opacity: 0.8;
}
/* Clear button for input fields */
.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: rgba(255,255,255,0.5);
    padding: 0 4px;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    display: none;
}
.clear-btn:hover {
    color: rgba(255,255,255,0.8);
}
/* Show clear button when input has value */
input:not(:placeholder-shown) + .clear-btn {
    display: block;
}
#viewList #tagFilter {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.5) !important;
    padding: 10px 12px;
    border-radius: 10px;
    width: 150px !important;
    height: 34px;
    box-sizing: border-box;
    color: var(--text-main);
    font-size: 14px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: 0.2s ease;
}
#viewList #tagFilter::placeholder {
    color: rgba(255,255,255,0.35);
}
#viewList #tagFilter:focus {
    border-color: rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.10);
}
#reportView {
    background: rgba(255,0,0,0.2);
}
canvas {
    pointer-events: auto;
}
/* ============================================================
   VIEWS
============================================================ */
.view{
    display:none;
    max-width:980px;
    margin:26px auto 40px auto;
    padding:0 18px 40px 18px;
}
.sectionHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
}
h2{
    margin:0 0 14px 0;
    font-size:22px;
    letter-spacing:0.06em;
    text-transform:uppercase;
    color:var(--text-main);
}
h3{
    margin-top:18px;
    margin-bottom:8px;
    font-size:15px;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color:var(--text-muted);
}
/* ============================================================
   BUTTONS
============================================================ */
.btn{
    background:linear-gradient(135deg, var(--accent), #7bc4ff);
    color:#05060a;
    border:none;
    padding: 9px 18px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    font-weight:600;
    letter-spacing:0.06em;
    text-transform:uppercase;
    box-shadow:0 10px 25px rgba(77,163,255,0.45);
    transition:var(--transition-fast);
}
.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 32px rgba(77,163,255,0.6);
}
.btn.secondary{
    background:linear-gradient(135deg, 
        rgba(45,52,75,0.95) 0%, 
        rgba(60,68,95,0.85) 50%,
        rgba(35,42,60,0.9) 100%);
    color:var(--text-main);
    border:1px solid rgba(255,255,255,0.12);
    box-shadow:0 4px 15px rgba(0,0,0,0.25), 
                inset 0 1px 0 rgba(255,255,255,0.15),
                inset 0 -1px 0 rgba(0,0,0,0.2);
    -webkit-backdrop-filter:blur(8px);
    backdrop-filter:blur(8px);
}

.tab-btn {
    background: linear-gradient(135deg,
        rgba(120,130,150,0.95) 0%,
        rgba(140,155,180,0.85) 50%,
        rgba(110,125,145,0.9) 100%);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 8px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25),
                inset 0 1px 0 rgba(255,255,255,0.25),
                inset 0 -1px 0 rgba(0,0,0,0.15);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.tab-btn:hover {
    color: var(--text-main);
    background: linear-gradient(135deg,
        rgba(140,155,180,0.95) 0%,
        rgba(165,185,210,0.85) 50%,
        rgba(130,150,175,0.9) 100%);
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35),
                inset 0 1px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: var(--text-main);
    background: linear-gradient(135deg,
        rgba(140,155,180,0.95) 0%,
        rgba(165,185,210,0.85) 50%,
        rgba(130,150,175,0.9) 100%);
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35),
                inset 0 1px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(0,0,0,0.1);
}

/* ============================================================
   VALUEINDEX LIST ITEMS – DARK THEME
============================================================ */
#viewValueIndexStats div[style*="padding: 12px 0"] {
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

#viewValueIndexStats div[style*="padding: 12px 0"]:hover {
    background: rgba(128, 128, 128, 0.15);
    border-left: 2px solid rgba(128, 128, 128, 0.5);
    padding-left: 8px;
    padding-right: 8px;
}

#viewValueIndexStats div[style*="padding: 12px 0"]:hover span:first-child {
    color: var(--accent);
}

.btn.secondary::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.1) 0%,
        transparent 50%,
        rgba(255,255,255,0.05) 100%);
    border-radius:999px;
    opacity:0.6;
}
.btn.secondary:hover{
    background:linear-gradient(135deg, 
        rgba(55,65,90,0.95) 0%, 
        rgba(70,80,110,0.85) 50%,
        rgba(45,52,75,0.9) 100%);
    color:var(--text-main);
    border-color:rgba(255,255,255,0.2);
    box-shadow:0 6px 20px rgba(0,0,0,0.35), 
                inset 0 1px 0 rgba(255,255,255,0.2),
                inset 0 -1px 0 rgba(0,0,0,0.15);
    transform:translateY(-1px);
}
.btn.secondary:hover::before{
    opacity:0.8;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.15) 0%,
        transparent 50%,
        rgba(255,255,255,0.08) 100%);
}
.btn.secondary:active{
    transform:translateY(0);
    box-shadow:0 2px 8px rgba(0,0,0,0.25), 
                inset 0 1px 0 rgba(255,255,255,0.1),
                inset 0 -1px 0 rgba(0,0,0,0.25);
}
/* Icon-only button styling */
.btn.icon-only {
    padding: 8px;
    min-width: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn.icon-only .refresh-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}
.btn.icon-only:hover .refresh-icon {
    transform: rotate(180deg);
}
/* Målvyns filterknappar (Alla / Färdiga / Pågående) – segmenterad kontroll */
.goalFilterGroup {
    display: inline-flex;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 3px;
}
.goalFilterBtn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.goalFilterBtn:hover {
    color: var(--text-main);
}
.goalFilterBtn.active {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}
/* Special silver metallic buttons for Settings, Market and PurchasedCoins in dark theme */
#viewSettings .btn.secondary,
#viewMarket .btn.secondary,
#viewPurchasedCoins .btn.secondary {
    background:linear-gradient(135deg, 
        rgba(120,130,150,0.95) 0%, 
        rgba(140,155,180,0.85) 50%,
        rgba(110,125,145,0.9) 100%);
    color:var(--text-main);
    border:1px solid rgba(255,255,255,0.18);
    box-shadow:0 4px 15px rgba(0,0,0,0.25), 
                inset 0 1px 0 rgba(255,255,255,0.25),
                inset 0 -1px 0 rgba(0,0,0,0.15);
    -webkit-backdrop-filter:blur(8px);
    backdrop-filter:blur(8px);
    position:relative;
}

/* Scale font-size in purchased coins view */
#viewPurchasedCoins {
    font-size: calc(1em * var(--ui-scale));
}

#viewPurchasedCoins .marketRow,
#viewPurchasedCoins .coinRow,
#viewPurchasedCoins .countryRow,
#viewPurchasedCoins .yearRow {
    font-size: inherit;
}

/* Scale font-size in about view */
#viewAbout {
    font-size: calc(1em * var(--ui-scale));
}
#viewSettings .btn.secondary::before,
#viewMarket .btn.secondary::before,
#viewPurchasedCoins .btn.secondary::before {
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.25) 0%,
        transparent 50%,
        rgba(255,255,255,0.12) 100%);
    border-radius:999px;
    opacity:0.7;
}
#viewSettings .btn.secondary:hover,
#viewMarket .btn.secondary:hover {
    background:linear-gradient(135deg, 
        rgba(140,155,180,0.95) 0%, 
        rgba(165,185,210,0.85) 50%,
        rgba(130,150,175,0.9) 100%);
    border-color:rgba(255,255,255,0.25);
    box-shadow:0 6px 20px rgba(0,0,0,0.35), 
                inset 0 1px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(0,0,0,0.1);
    transform:translateY(-1px);
}
#viewSettings .btn.secondary:hover::before,
#viewMarket .btn.secondary:hover::before {
    opacity:0.9;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.35) 0%,
        transparent 50%,
        rgba(255,255,255,0.18) 100%);
}
#viewSettings .btn.secondary:active,
#viewMarket .btn.secondary:active {
    transform:translateY(0);
    box-shadow:0 2px 8px rgba(0,0,0,0.25), 
                inset 0 1px 0 rgba(255,255,255,0.2),
                inset 0 -1px 0 rgba(0,0,0,0.2);
}
/* Ensure refresh icon inherits proper color in Market view */
#viewMarket .btn.icon-only .refresh-icon {
    stroke: currentColor !important;
    fill: none !important;
    color: var(--text-main) !important;
}
#viewMarket .btn.icon-only {
    color: var(--text-main) !important;
}
/* Premium silver Report button in collection view - EXACTLY like Menu/My Collection but smaller */
#viewList .tagFilterWrapper .btn.secondary[onclick="showFilterReport()"] {
    background: linear-gradient(
        135deg,
        #dfe4ef 0%,
        #f8f9fb 35%,
        #caced8 55%,
        #e6e8ee 100%
    );
    color: #0a0c14;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 14px rgba(255,255,255,0.18),
        inset 0 0 6px rgba(255,255,255,0.25);
    transition: 0.25s ease;
    filter: brightness(0.83);
}
#viewList .tagFilterWrapper .btn.secondary[onclick="showFilterReport()"]:hover {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f2f3f7 40%,
        #d4d7df 70%,
        #fafbff 100%
    );
    box-shadow:
        0 0 10px rgba(255,255,255,0.55),
        0 0 18px rgba(255,255,255,0.35),
        inset 0 0 8px rgba(255,255,255,0.35);
    transform: translateY(-1px);
    filter: brightness(1);
}
#viewList .tagFilterWrapper .btn.secondary[onclick="showFilterReport()"]:active {
    transform: translateY(0);
}
/* Lägg till button in tagFilterWrapper - match Rapport button exactly */
#viewList .tagFilterWrapper #btnAddCoin {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
}
/* ============================================================
   VALUTA-VAL MODAL KNAPPAR
============================================================ */
#currencyModal .btn.primary {
    background: linear-gradient(
        135deg,
        #dfe4ef 0%,
        #f8f9fb 35%,
        #caced8 55%,
        #e6e8ee 100%
    );
    color: #0a0c14;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 14px rgba(255,255,255,0.18),
        inset 0 0 6px rgba(255,255,255,0.25);
    transition: 0.25s ease;
    filter: brightness(0.83);
}
#currencyModal .btn.primary:hover {
    background: linear-gradient(
        135deg,
        #e8ecf5 0%,
        #ffffff 35%,
        #d8dce4 55%,
        #f0f2f6 100%
    );
    box-shadow:
        0 0 8px rgba(255,255,255,0.45),
        0 0 18px rgba(255,255,255,0.25),
        inset 0 0 8px rgba(255,255,255,0.35);
    transform: translateY(-1px);
    filter: brightness(1);
}
#currencyModal .btn.primary:active {
    transform: translateY(0);
}
/* ============================================================
   PREMIUM SILVERKNAPP – ENDAST FÖR "Meny" och "Min samling"
============================================================ */
nav .dropbtn,
nav button[onclick="showView('list')"] {
    background: linear-gradient(
        135deg,
        #dfe4ef 0%,
        #f8f9fb 35%,
        #caced8 55%,
        #e6e8ee 100%
    );
    color: #0a0c14;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 14px rgba(255,255,255,0.18),
        inset 0 0 6px rgba(255,255,255,0.25);
    transition: 0.25s ease;
}
nav .dropbtn,
nav button[onclick="showView('list')"] {
    filter: brightness(0.83);
    transition: filter 0.25s ease, transform 0.25s ease;
}
nav .dropbtn:hover,
nav button[onclick="showView('list')"]:hover {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f2f3f7 40%,
        #d4d7df 70%,
        #fafbff 100%
    );
    box-shadow:
        0 0 10px rgba(255,255,255,0.55),
        0 0 18px rgba(255,255,255,0.35),
        inset 0 0 8px rgba(255,255,255,0.35);
    transform: translateY(-1px);
    filter: brightness(1);
}
/* ============================================================
   PREMIUM SILVERTITEL – EXTRA METALLISK VERSION
============================================================ */
.CoinIndex-title {
    display: inline-block;
    background: linear-gradient(
        135deg,
        #f5f7fa 0%,
        #ffffff 22%,
        #d7dbe3 48%,
        #eef0f5 100%
    );
    color: #05060a;
    border: 1px solid rgba(255,255,255,0.55);
    padding: 14px 32px;
    border-radius: 999px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    box-shadow:
        0 0 10px rgba(255,255,255,0.45),
        0 0 22px rgba(255,255,255,0.25),
        inset 0 0 10px rgba(255,255,255,0.35);
    transition: 0.25s ease;
}
.CoinIndex-title:hover {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f7f8fc 30%,
        #d2d6de 65%,
        #fdfdff 100%
    );
    box-shadow:
        0 0 14px rgba(255,255,255,0.65),
        0 0 26px rgba(255,255,255,0.40),
        inset 0 0 12px rgba(255,255,255,0.45);
    transform: translateY(-1px);
}
/* ============================================================
   SÖKFUNKTION
=============================================================*/
.compactRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
}
.compactThumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}
.compactInfo {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.2;
}
/* ============================================================
   LISTVY
============================================================ */
.card{
    background:var(--bg-card);
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding: calc(12px * var(--ui-scale));
}
.countryRow,.yearRow,.coinRow{
    border-radius:10px;
    border:1px solid rgba(255,255,255,0.04);
    background:linear-gradient(135deg, rgba(255,255,255,0.02), rgba(10,12,20,0.96));
    box-shadow:0 10px 26px rgba(0,0,0,0.7);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: calc(6px * var(--ui-scale)) calc(14px * var(--ui-scale));
    margin-bottom: calc(4px * var(--ui-scale));
    cursor:pointer;
    transition:var(--transition-fast);
}
.countryRow:hover,.yearRow:hover,.coinRow:hover{
    transform:translateY(-1px);
    border-color:rgba(77,163,255,0.4);
}
.yearRow{ margin-left:10px; }
.coinRow{ margin-left:26px; }
.coinThumb{
    width:60px;
    height:60px;
    border-radius:10px;
    box-shadow:0 10px 26px rgba(0,0,0,0.8);
    object-fit:cover;
}
.flagSmall{
    width:20px;
    height:20px;
    border-radius:6px;
    box-shadow:0 0 0 1px rgba(255,255,255,0.18);
}
/* ============================================================
   DETALJVY
============================================================ */
.detailBox{
    background:var(--bg-card);
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding:18px;
    margin-bottom:16px;
}
.detailImage{
    width:110px;
    height:110px;
    border-radius:12px;
    box-shadow:0 18px 40px rgba(0,0,0,0.9);
    margin-bottom:12px;
    object-fit:cover;
}
/* ============================================================
   MARKNAD
============================================================ */
.marketCard{
    background:var(--bg-card);
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding:16px 18px;
    margin-bottom:14px;
}
.marketRow{
    background:linear-gradient(135deg, rgba(255,255,255,0.02), rgba(10,12,20,0.96));
    border-radius:10px;
    border:1px solid rgba(255,255,255,0.06);
    padding:12px 14px;
    margin-bottom:8px;
    cursor:pointer;
    display:flex;
    justify-content:space-between;
    transition:0.2s ease;
}
.marketRow:hover{
    border-color:rgba(77,163,255,0.4);
}
.deleteIcon{
    color:#ff6666;
    font-weight:bold;
    opacity:0.7;
    transition:0.15s;
}
.marketRow:hover .deleteIcon{
    opacity:1;
}
/* ============================================================
   CANVAS (diagram)
============================================================ */
canvas{
    background:#10121a;
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding:18px;
    margin-top:10px;
    min-height: 300px;
}
/* ============================================================
   PREMIUM DARK INPUTS – MATCHAR APPENS DESIGN
============================================================ */
.card input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(20,24,38,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: 0.25s ease;
  box-shadow: inset 0 0 0 0 rgba(77,163,255,0);
  caret-color: #ffffff;
}
.card input:hover {
    background: rgba(20,24,38,0.92);
    border-color: rgba(255,255,255,0.12);
}
.card input:focus {
    background: rgba(12,14,22,0.98);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(77,163,255,0.35);
    outline: none;
}
datalist option {
    background: rgba(10, 14, 28, 0.95) !important;
    color: var(--text-main) !important;
}

/* ============================================================
   PREMIUM INPUT WITH DATALIST – MATCHAR APPENS DESIGN
============================================================ */
input.premium-select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(20,24,38,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: 0.25s ease;
  box-shadow: inset 0 0 0 0 rgba(77,163,255,0);
}

input.premium-select:hover {
    background: rgba(20,24,38,0.92);
    border-color: rgba(255,255,255,0.12);
}

input.premium-select:focus {
    background: rgba(12,14,22,0.98);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(77,163,255,0.35);
    outline: none;

    .goal-year-badge.exists {
        background: rgba(34, 197, 94, 0.15);
        border-color: rgba(34, 197, 94, 0.5);
        color: #22c55e;
    }

    .goal-year-badge.missing {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.5);
        color: #ef4444;
    }

    .goal-year-badge .remove-hint {
        position: absolute;
        top: 2px;
        right: 6px;
        font-size: 12px;
        opacity: 0.4;
        transition: opacity 0.2s ease;
    }

    .goal-year-badge:hover .remove-hint {
        opacity: 0.8;
    }

    /* ============================================================
       PREMIUM INPUT WITH DATALIST – MATCHAR APPENS DESIGN
    ============================================================= */
    input.premium-select {
      width: 100%;
      padding: 12px 14px;
      margin-bottom: 12px;
      background: rgba(20,24,38,0.95);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 8px;
      color: var(--text-main);
      font-size: 15px;
      letter-spacing: 0.02em;
      transition: 0.25s ease;
      box-shadow: inset 0 0 0 0 rgba(77,163,255,0);
    }

    input.premium-select:hover {
        background: rgba(20,24,38,0.92);
        border-color: rgba(255,255,255,0.12);
    }

    input.premium-select:focus {
        background: rgba(12,14,22,0.98);
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(77,163,255,0.35);
        outline: none;
    }

    datalist option {
        background: rgba(10, 14, 28, 0.95);
        color: var(--text-main);
        padding: 10px;
    }
    /* Custom Dropdown */
    .custom-dropdown {
        position: relative;
        width: 100%;
        margin-bottom: 12px;
    }
    .custom-dropdown input {
        width: 100%;
        padding: 12px 36px 12px 16px;
        background: rgba(10, 14, 28, 0.85);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 12px;
        color: var(--text-main);
        font-size: 14px;
        letter-spacing: 0.02em;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
        caret-color: #ffffff;
    }
    .custom-dropdown input:focus {
        background: rgba(12,14,22,0.98);
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(77,163,255,0.35);
        outline: none;
    }
    .custom-dropdown input:hover {
        background: rgba(20,24,38,0.92);
        border-color: rgba(255,255,255,0.12);
    }
    .dropdown-arrow {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: #9aa0b5;
        pointer-events: none;
        font-size: 10px;
        transition: transform 0.3s ease;
    }
    .custom-dropdown.open .dropdown-arrow {
        transform: translateY(-50%) rotate(180deg);
    }
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 4px;
        background: rgba(10, 14, 28, 0.98);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        max-height: 200px;
        overflow-y: auto;
        z-index: 1000;
        display: none;
    }
    .custom-dropdown.open .dropdown-menu {
        display: block;
    }
    .dropdown-item {
        padding: 10px 16px;
        color: var(--text-main);
        font-size: 14px;
        cursor: pointer;
        transition: background 0.2s ease;
        line-height: 1.2 !important;
    }
    .dropdown-item:hover {
        background: rgba(77,163,255,0.15);
    }
    .dropdown-item.hidden {
        display: none;
    }
    .card label {
        display: block;
        margin-bottom: 4px;
        margin-top: 10px;
        font-size: 12px;
        color: var(--text-muted);
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    /* ============================================================
       TOPPLISTA – ENDAST UNDERRUBRIKER
    ============================================================= */
    .topHeader {
        text-align: center;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        font-size: 15px;
        padding: 14px 0;
        margin-top: 18px;
        cursor: pointer;
        color: var(--text-main);
        transition: 0.25s ease;
        text-shadow: 0 0 6px rgba(200,200,255,0.18);
    }
    .topHeader:hover {
        text-shadow: 0 2px 8px rgba(255,255,255,0.25);
        color: #ffffff;
    }
    /* Force top lists to always be visible */
    #viewTop .accContent {
        display: block !important;
    }
    /* ============================================================
       TOPPLISTA – PREMIUM FÄRGER FÖR TOPP 10
    ============================================================= */
    .toplist-item {
        padding: 12px 16px;
        margin-bottom: 8px;
        background: rgba(10,14,22,0.85);
        border: 1px solid rgba(255,255,255,0.06);
        border-radius: 10px;
        color: var(--text-main);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 15px;
        letter-spacing: 0.02em;
    }
    .toplist-1 {
        background: linear-gradient(
            135deg,
            #8A6B2F 0%,
            #C8A44E 35%,
            #F0D58A 55%,
            #A8843A 100%
        );
        color: #1a1a1a;
        font-weight: 700;
    }
    .toplist-2 {
        background: linear-gradient(
            135deg,
            #6F737A 0%,
            #AEB4C0 35%,
            #E6E8ED 55%,
            #8F949C 100%
        );
        color: #1a1a1a;
        font-weight: 700;
    }
    .toplist-3 {
        background: linear-gradient(
            135deg,
            #6A4F2C 0%,
            #9C7444 35%,
            #D8A86A 55%,
            #8A653A 100%
        );
        color: #1a1a1a;
        font-weight: 700;
    }
    .coinThumbWrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        cursor: pointer;
    }
    .clickHint {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 4px;
        opacity: 0.7;
    }
    .toplist-item {
        cursor: pointer;
        transition: 0.2s ease;
    }
    .toplist-item:hover {
        transform: translateY(-2px);
        border-color: rgba(77,163,255,0.35);
        background: rgba(255,255,255,0.05);
    }
    /* ============================================================
       STATISTIK – ÖVERSIKT
    ============================================================= */
    .statsOverview {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
        margin-top: 20px;
    }
    .statsBox {
        background: var(--bg-card);
        border-radius: var(--radius-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-soft);
        padding: 18px;
        text-align: center;
    }
    .statsNumber {
        font-size: 28px;
        font-weight: 700;
        color: var(--accent);
        margin-bottom: 6px;
    }
    margin-bottom: 12px;
}
.custom-dropdown input {
    width: 100%;
    padding: 12px 36px 12px 16px;
    background: rgba(10, 14, 28, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    caret-color: #ffffff;
}
.custom-dropdown input:focus {
    background: rgba(12,14,22,0.98);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(77,163,255,0.35);
    outline: none;
}
.custom-dropdown input:hover {
    background: rgba(20,24,38,0.92);
    border-color: rgba(255,255,255,0.12);
}
.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0b5;
    pointer-events: none;
    font-size: 10px;
    transition: transform 0.3s ease;
}
.custom-dropdown.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(10, 14, 28, 0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.custom-dropdown.open .dropdown-menu {
    display: block;
}
.dropdown-item {
    padding: 10px 16px;
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1.2 !important;
}
.dropdown-item:hover {
    background: rgba(77,163,255,0.15);
}
.dropdown-item.hidden {
    display: none;
}
.card label {
    display: block;
    margin-bottom: 4px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
/* ============================================================
   TOPPLISTA – ENDAST UNDERRUBRIKER
============================================================ */
.topHeader {
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 15px;
    padding: 14px 0;
    margin-top: 18px;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.25s ease;
    text-shadow: 0 0 6px rgba(200,200,255,0.18);
}
.topHeader:hover {
    text-shadow: 0 2px 8px rgba(255,255,255,0.25);
    color: #ffffff;
}
/* Force top lists to always be visible */
#viewTop .accContent {
    display: block !important;
}
/* ============================================================
   TOPPLISTA – PREMIUM FÄRGER FÖR TOPP 10
============================================================ */
.toplist-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(10,14,22,0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    letter-spacing: 0.02em;
}
.toplist-1 {
    background: linear-gradient(
        135deg,
        #8A6B2F 0%,
        #C8A44E 35%,
        #F0D58A 55%,
        #A8843A 100%
    );
    color: #1a1a1a;
    font-weight: 700;
}
.toplist-2 {
    background: linear-gradient(
        135deg,
        #6F737A 0%,
        #AEB4C0 35%,
        #E6E8ED 55%,
        #8F949C 100%
    );
    color: #1a1a1a;
    font-weight: 700;
}
.toplist-3 {
    background: linear-gradient(
        135deg,
        #6A4F2C 0%,
        #9C7444 35%,
        #D8A86A 55%,
        #8A653A 100%
    );
    color: #1a1a1a;
    font-weight: 700;
}
.coinThumbWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.clickHint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    opacity: 0.7;
}
.toplist-item {
    cursor: pointer;
    transition: 0.2s ease;
}
.toplist-item:hover {
    transform: translateY(-2px);
    border-color: rgba(77,163,255,0.35);
    background: rgba(255,255,255,0.05);
}
/* ============================================================
   STATISTIK – ÖVERSIKT
============================================================ */
.statsOverview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 20px;
}
.statsBox {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    text-align: center;
}
.statsNumber {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}
.statsLabel {
    font-size: 14px;
    opacity: 0.7;
}
/* ============================================================
   STATISTIK – BÄSTA KÖP
============================================================ */
.bestBuys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}
.bestBuyCategory {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}
.bestBuyTitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}
.bestBuyItem {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    line-height: 1.35;
    cursor: pointer;
    transition: 0.15s ease;
}
.bestBuyItem:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.05);
}
/* ============================================================
   SÄLJARÖVERSIKT MODAL
============================================================ */
.seller-coins-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
    padding: 8px 20px;
}
.seller-coin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}
.seller-coin-item:last-child {
    border-bottom: none;
}
.seller-coin-name {
    color: var(--text-main);
    font-weight: 500;
}
.seller-coin-price {
    color: var(--text-muted);
    font-size: 12px;
}
.seller-coins-link {
    cursor: pointer;
    text-decoration: none;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.seller-coins-link:hover {
    background: rgba(77, 163, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(77, 163, 255, 0.3);
}
/* ============================================================
   SÄLJAR MYNT LISTA MODAL
============================================================ */
.seller-coins-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}
.seller-coins-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    max-width: 400px;
    width: 90%;
    max-height: 60vh;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}
.seller-coins-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}
.seller-coins-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.seller-coins-modal-header .modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-fast);
}
.seller-coins-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
.seller-coins-modal-body {
    padding: 16px 20px;
    max-height: calc(60vh - 60px);
    overflow-y: auto;
}
.seller-coins-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
}
.seller-coins-modal-item:last-child {
    border-bottom: none;
}
.seller-coins-modal-name {
    color: var(--text-main);
    font-weight: 500;
}
.seller-coins-modal-price {
    color: var(--text-muted);
    font-size: 13px;
}

.coinName {
    font-weight: 500;
    opacity: 0.9;
    color: #c8d0ff;
}
.storageItem {
    background: rgba(10,14,22,0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s ease;
    cursor: pointer;
}
.storageItem:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(77,163,255,0.35);
    transform: translateY(-1px);
}
.storagePlace {
    font-size: 15px;
    color: var(--text-main);
    letter-spacing: 0.3px;
}
.storageValue {
    font-size: 17px;
    font-weight: 600;
    color: var(--accent);
}
.statsHeader {
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
}
#marketSellList {
    min-height: 40px;
}
.storageBox {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}
.storageBox:hover {
    transform: translateY(-3px);
    background: var(--bg-elevated);
}
.storageBox .statsNumber {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}
.storageBox .statsLabel {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}
.collectionSort {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.sortBtn {
    padding: 10px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.sortBtn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}
.sortBtn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}
.btn.danger {
    background: #4a1a1a;
    color: #c8bcbc;
    border: 1px solid #6b2a2a;
    transition: 0.25s ease;
}
.btn.danger:hover {
    background: #5c1f1f;
    color: #d8d0d0;
    box-shadow: 0 0 6px rgba(120, 40, 40, 0.35);
    transform: translateY(-1px);
}
#btnDeleteCoin {
    margin-left: 20px;
}
/* ============================================================
   SCROLL TO TOP BUTTON
============================================================ */
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7bc4ff);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(77, 163, 255, 0.4);
    z-index: 1000;
}
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(77, 163, 255, 0.6);
}
.scroll-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(77, 163, 255, 0.5);
}
.scroll-to-top svg {
    color: #05060a;
    transition: transform 0.3s ease;
}
.scroll-to-top:hover svg {
    transform: translateY(-2px);
}
/* ============================================================
   RARITY TOOLTIP
============================================================ */
.rarity-tooltip {
    position: relative;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: border-bottom-color 0.2s ease;
    cursor: text;
}
.rarity-tooltip:hover {
    border-bottom-color: var(--accent);
}
.rarity-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 8px 14px;
    background: var(--bg-secondary);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}
.rarity-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-6px);
}
/* ============================================================
   SILVER TOOLTIP
============================================================ */
.silver-tooltip {
    position: relative;
    cursor: help;
}
.silver-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%) translateX(-8px);
    padding: 10px 16px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.silver-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-12px);
}
#detailImage2 {
    opacity: 1;
}
/* ============================================================
   RESPONSIVE
============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .view {
        max-width: 100%;
        padding: 0 24px 40px 24px;
    }
    header {
        padding: 16px 24px;
    }
    .btn {
        padding: calc(12px * var(--ui-scale)) calc(24px * var(--ui-scale));
        min-height: 44px;
        touch-action: manipulation;
    }
    .vc-search input[type="text"],
    .card input {
        padding: 14px 18px;
        min-height: 48px;
    }
}

@media (max-width: 768px) {
    header{
        flex-direction:column;
        gap:12px;
        padding:12px;
    }
    nav{
        flex-direction:column;
        width:100%;
        gap: 12px;
    }
    nav button {
        padding: 10px 16px;
        font-size: 12px;
    }
    .collectionSort{
        flex-direction:column;
        align-items:stretch;
    }
    .tagFilterWrapper{
        flex-direction:column;
        align-items:stretch;
    }
    .btn {
        padding: 9px 18px;
        min-height: 44px;
        touch-action: manipulation;
    }
    .vc-search input[type="text"],
    .card input {
        padding: 14px 18px;
        min-height: 48px;
    }
}

/* ============================================================
   CHART SECTIONS - ALWAYS VISIBLE (FORCE DARK THEME)
============================================================ */
.chart-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 12px !important;
    padding: 28px !important;
    margin-bottom: 24px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

.chart-section * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chart-section h3 {
    margin: 0 0 20px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chart-section canvas {
    max-height: 380px !important;
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
}

/* Force chart visibility in all contexts */
body.dark-theme .chart-section,
.dark-theme .chart-section,
.theme-dark .chart-section,
[data-theme="dark"] .chart-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.dark-theme .chart-section *,
.dark-theme .chart-section *,
.theme-dark .chart-section *,
[data-theme="dark"] .chart-section * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Override any hidden states */
.chart-section.hidden,
.chart-section[style*="display: none"],
.chart-section[style*="visibility: hidden"],
.chart-section[style*="opacity: 0"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

:root {
    --chart-text: #ffffff !important;
    --chart-label-bg: transparent !important;
}

/* ============================================================
   THEME SWITCHING - PREVENT FLICKER
============================================================ */
html.theme-switching .chart-section {
    opacity: 1 !important;
    visibility: visible !important;
}

.theme-switch.info-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Seller link styling */
.seller-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted var(--accent);
    transition: all 0.2s ease;
}

.seller-link:hover {
    color: var(--accent-warm);
    border-bottom-color: var(--accent-warm);
}

/* Seller Overview Modal */
#sellerOverviewModal {
    position: absolute;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

#sellerOverviewModal[style*="block"] {
    opacity: 1;
}

.seller-overview-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    max-width: 280px;
    width: auto;
    margin: 0;
}

.seller-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: visible;
    max-height: 80vh;
    overflow-y: auto;
}

.seller-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.seller-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.seller-modal-body {
    padding: 0;
}

.seller-info-grid {
    padding: 16px 20px;
}

.seller-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.seller-info-item:last-child {
    border-bottom: none;
}

#purchasedCoinsAnalysisModal .modal-body > div > div:last-child {
    border-bottom: none !important;
}

/* Subtil och elegant markering mellan snittpris och katalogvärde */
#purchasedCoinsAnalysisModal .modal-body > div > div:nth-child(5) {
    border-bottom: 1px solid var(--border-subtle) !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
}

.seller-info-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.seller-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.seller-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 12px 0;
}

.seller-subheading {
    font-size: 12px;
    font-weight: 600;
    color: #5B7FFF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px 0;
}

/* ============================================================
   PREMIUM VALUE BUTTON
============================================================ */
.premium-value-btn {
    background: linear-gradient(145deg, #e8eaed, #9ca5b4, #7d8491);
    color: #1a1f2e;
    border: none;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 
        0 2px 8px rgba(139, 146, 163, 0.4),
        inset 0 1px 2px rgba(255,255,255,0.6),
        inset 0 -1px 2px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.premium-value-btn:hover {
    background: linear-gradient(145deg, #f5f7fa, #b5bcc8, #8b92a3);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(139, 146, 163, 0.5),
        inset 0 1px 2px rgba(255,255,255,0.8),
        inset 0 -1px 2px rgba(0,0,0,0.1);
}

.premium-value-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(139, 146, 163, 0.3),
        inset 0 1px 2px rgba(255,255,255,0.4),
        inset 0 -1px 2px rgba(0,0,0,0.3);
}

.premium-value-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255,255,255,0.8), 
        rgba(255,255,255,0.6),
        transparent
    );
    transition: left 0.6s ease;
}

.premium-value-btn:hover::before {
    left: 100%;
}

.premium-value-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.3),
        transparent
    );
    border-radius: 999px 999px 0 0;
    pointer-events: none;
}

/* ------------------------------------------------------------
   BILDFÖRHANDSVISNINGAR
------------------------------------------------------------ */
.image-preview-small {
    width: 120px;
    border-radius: 10px;
    cursor: pointer;
}

/* Date input styling - make calendar picker more visible */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
    padding: 5px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Date input tooltip */
input[type="date"] {
    position: relative;
}

input[type="date"]::after {
    content: "Klicka på kalendern för att välja datum";
    position: absolute;
    top: -30px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

input[type="date"]:hover::after,
input[type="date"]:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-4px);
}

/* Date field tooltip - one-time tip */
.date-field-tooltip {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.tooltip-close {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tooltip-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* ------------------------------------------------------------
   FORMULÄR - NOTERING
------------------------------------------------------------ */
.textarea-notering {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    letter-spacing: 0.02em;
    resize: vertical;
}

/* ------------------------------------------------------------
   SAMLINGENS VÄGLEDNING
------------------------------------------------------------ */
.guidance-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 16px 0;
    font-style: italic;
}

.guidance-textarea {
    width: 100%;
    min-height: 420px;
    padding: 20px 22px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.guidance-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.guidance-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    opacity: 0.7;
}

/* ------------------------------------------------------------
   MENY - DIVIDER
------------------------------------------------------------ */
.menu-divider {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 6px 0;
}

/* ------------------------------------------------------------
   HIDDEN ELEMENTS
------------------------------------------------------------ */
.hidden {
    display: none;
}

/* ------------------------------------------------------------
   BUTTON ROWS
------------------------------------------------------------ */
.button-row {
    display: flex;
    gap: 10px;
}

/* ------------------------------------------------------------
   MARGIN HELPER CLASSES
------------------------------------------------------------ */
.margin-top-0 { margin-top: 0; }
.margin-top-4 { margin-top: 4px; }
.margin-top-6 { margin-top: 6px; }
.margin-top-10 { margin-top: 10px; }
.margin-top-14 { margin-top: 14px; }
.margin-top-16 { margin-top: 16px; }
.margin-top-18 { margin-top: 18px; }
.margin-top-20 { margin-top: 20px; }
.margin-top-neg6 { margin-top: -6px; }

.margin-bottom-14 { margin-bottom: 14px; }
.margin-bottom-12 { margin-bottom: 12px; }
.margin-bottom-20 { margin-bottom: 20px; }

/* ------------------------------------------------------------
   TEXT HELPER CLASSES
------------------------------------------------------------ */
.font-small { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-italic { font-style: italic; }
.opacity-70 { opacity: 0.7; }

.font-24 { font-size: 24px; }
.font-weight-600 { font-weight: 600; }
.color-accent { color: var(--accent); }
.text-center { text-align: center; }

.font-14 { font-size: 14px; }
.font-16 { font-size: calc(16px * var(--ui-scale)); }
.font-13 { font-size: 13px; }
.line-height-155 { line-height: 1.55; }
.color-main { color: var(--text-main); }
.opacity-90 { opacity: 0.9; }
.white-space-pre-wrap { white-space: pre-wrap; }

/* ------------------------------------------------------------
   FLEX HELPER CLASSES
------------------------------------------------------------ */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-20 { gap: 20px; }
.cursor-pointer { cursor: pointer; }

/* ------------------------------------------------------------
   BACKGROUND HELPER CLASSES
------------------------------------------------------------ */
.bg-danger { background: #922; }
.bg-delete { background: #b00020; }
.bg-modal { background: #141824; }
.bg-report-btn { background: #4da3ff; }
.bg-gradient-light { background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)); }

/* ------------------------------------------------------------
   PADDING HELPER CLASSES
------------------------------------------------------------ */
.padding-4 { padding: 4px; }
.padding-8 { padding: 8px; }
.padding-10 { padding: 10px; }
.padding-12 { padding: 12px; }
.padding-20 { padding: 20px; }
.padding-24 { padding: 24px; }
.padding-10-20 { padding: 10px 20px; }

.btn.secondary.selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent) !important;
}

/* Delete button on coin editing view - distinguished style */
#viewForm .btn.secondary#btnDeleteCoin {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

#viewForm .btn.secondary#btnDeleteCoin:hover {
    background: rgba(220, 38, 38, 0.25);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.5);
    transform: none;
    box-shadow: none;
}

/* ============================================================
   VÄRDEÖVERSIKT MODAL
============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    opacity: 1;
}

.value-overview-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    max-width: 70%;
    width: 70%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .value-overview-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-overlay.show .report-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ------------------------------------------------------------
   DELETE ALL MODAL - Bakgrundsruta för båda teman
------------------------------------------------------------ */
.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 40px 20px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 1;
    flex: 1;
    background: linear-gradient(135deg, var(--text-main) 0%, rgba(255, 255, 255, 0.9) 50%, var(--text-main) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body {
    padding: 32px 40px 40px 40px;
    background: var(--bg-card);
}

#goalIndexModal .modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

#goalIndexModal .modal-body {
    background: var(--bg-card) !important;
}

/* ------------------------------------------------------------
   FÖRVARINGSPLATS DETALJER MODAL
------------------------------------------------------------- */
.storage-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.storage-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.storage-detail-item label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.storage-detail-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.value-trend-indicator {
    display: flex;
    align-items: center;
    position: absolute;
    right: 50px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: absolute;
    right: 8px;
}

.trend-arrow {
    font-size: 18px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    cursor: help;
}

.trend-arrow.up {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.trend-arrow.neutral {
    color: var(--text-muted);
    background: rgba(139, 146, 163, 0.1);
}

.trend-arrow.down {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.trend-arrow::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

.trend-arrow:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}


.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-main);
}

.report-header {
    position: relative;
    padding: 48px 60px 32px 60px;
    border-bottom: 1px solid rgba(192, 192, 192, 0.15);
    background: var(--bg-card);
}

.report-header .modal-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.report-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.25), transparent);
}

.report-modal {
    background: var(--bg-card);
    border: 1px solid rgba(192, 192, 192, 0.3);
    border-radius: 16px;
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.5),
        0 15px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.report-header h3 {
    margin: 0 auto;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    max-width: calc(100% - 60px);
    padding-bottom: 8px;
}

.report-content {
    padding: 48px 60px;
    max-height: 60vh;
    overflow-y: auto;
}

.report-text {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 17px;
    line-height: 2.0;
    color: var(--text-main);
    white-space: pre-wrap;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    text-align: center;
    letter-spacing: 0.3px;
}

.report-footer {
    padding: 32px 60px 48px 60px;
    border-top: 1px solid rgba(192, 192, 192, 0.1);
    background: var(--bg-card);
    display: flex;
    justify-content: center;
}

.report-footer .btn {
    min-width: 120px;
    max-width: 200px;
}

.modal-body {
    padding: 40px;
}


.value-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 8px;
}

.value-item.full-width {
    grid-column: span 2;
}

.value-item {
    background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.value-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

.value-item:hover::before {
    opacity: 1;
}

.value-item label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    text-align: center;
    opacity: 0.7;
}

.value-amount {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0;
    text-align: center;
    letter-spacing: -0.5px;
}

.value-item:nth-child(4) .value-amount {
    color: var(--accent);
    font-size: 30px;
    text-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
}

.value-item:nth-child(5) .value-amount {
    color: var(--text-muted);
}

/* ============================================================
   WELCOME TIP - NY ANVÄNDARE
============================================================ */
.welcome-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1d29;
    color: var(--text-color);
    padding: 18px 22px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 14px !important;
    overflow-y: auto;
}

.welcome-tip * {
    font-size: inherit !important;
}

.welcome-tip.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
}

/* ------------------------------------------------------------
   SPOTLIGHT MODAL - DAGENS MYNT
============================================================ */
.spotlight-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.spotlight-image {
    width: 100%;
    max-width: 300px;
    max-height: 300px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    align-self: center;
    background: var(--bg-elevated);
}

.spotlight-text {
    line-height: 1.6;
    font-size: 14px;
}

.spotlight-subtitle {
    font-size: 16px;
    font-weight: 600;
    margin-top: -8px;
    margin-bottom: 8px;
    color: var(--accent);
}

.tip-btn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.search-info-input-wrapper {
    margin: 15px 0;
}

.search-info-input-wrapper input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(20,24,38,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 15px;
    letter-spacing: 0.02em;
    transition: 0.25s ease;
    box-shadow: inset 0 0 0 0 rgba(77,163,255,0);
}

.search-info-input-wrapper input:hover {
    background: rgba(20,24,38,0.92);
    border-color: rgba(255,255,255,0.12);
}

.search-info-input-wrapper input:focus {
    background: rgba(12,14,22,0.98);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(77,163,255,0.35);
    outline: none;
}

.search-info-input-wrapper input::placeholder {
    color: rgba(255,255,255,0.55);
}

.tip-checkbox {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.value-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}
.value-icon-right {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}
.value-icon-right svg {
    display: block;
    width: 16px;
    height: 16px;
}
.premium-value-btn {
    color: #1a1f2e; /* mörk, synlig färg */
}

/* ============================================================
   SÄLLSYNTHET-SLIDER
============================================================ */
.rarity-container {
    margin: 8px 0 16px 0;
}

.rarity-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        #cc0000 0%,     /* Djup röd - mycket ovanlig */
        #ff0000 20%,    /* Stark röd - ovanlig */
        #ff4444 40%,    /* Medium röd */
        #8888ff 60%,    /* Medium blå */
        #4444ff 80%,    /* Stark blå - vanlig */
        #0066ff 100%    /* Djup blå - mycket vanlig */
    );
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.rarity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rarity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.rarity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rarity-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.rarity-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.rarity-rare {
    color: #ff4444;
    font-weight: 500;
}

.rarity-common {
    color: #4444ff;
    font-weight: 500;
}

.rarity-current {
    font-weight: 600;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-elevated);
}

.textarea-notering {
    margin-top: 20px;
    border: 2px solid var(--border-input);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg-elevated);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

.textarea-notering:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

/* Sortera-dropdown för köpta mynt */
#sortPurchasedCoinsDropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.15s ease;
}

#sortPurchasedCoinsDropdown .dropdown-item:hover {
    background-color: var(--bg-hover);
}

#sortPurchasedCoinsDropdown .dropdown-item.active {
    background-color: var(--bg-hover);
    font-weight: 500;
}

#sortPurchasedCoinsDropdown .dropdown-item.active::before {
    content: "✓";
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    min-width: 16px;
}

/* Info-ikon för köpta mynt - mörkt tema */
.info-icon {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: default;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    font-weight: 600;
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.2s ease;
}

.info-icon:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   MÅL (GOALS) - DARK THEME
============================================================ */
.goal-years-container {
    margin-top: 15px;
}

.goal-year-badge {
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    position: relative;
}

.goal-year-badge:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

.goal-year-badge.exists {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.goal-year-badge.missing {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.goal-year-badge .remove-hint {
    position: absolute;
    top: 2px;
    right: 6px;
    font-size: 12px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.goal-year-badge:hover .remove-hint {
    opacity: 0.8;
}
/* ------------------------------------------------------------
   CUSTOM DROPDOWN - basregel (återställd på toppnivå)
   Originalet hamnade nästat i ett obrutet block tidigare i
   filen och gällde därför inte. Utan position:relative
   positioneras .dropdown-menu mot fel förfader.
------------------------------------------------------------- */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}
