@font-face {
    font-family: 'Exocet';
    src: url('films.EXH_____.ttf') format('truetype');
}

:root {
    --bg-dark: #0a0a0c;
    --bg-card: #16161a;
    --bg-card-hover: #1c1c22;
    --primary: #c9a24d;
    --primary-glow: rgba(201, 162, 77, 0.4);
    --text-main: #e2e2e2;
    --text-dim: #9ca3af;
    --accent-red: #b91c1c;
    --accent-blue: #1e3a8a;
    --accent-green: #064e3b;
    --border: #2d2d35;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s ease;

    /* diablo2.io Colors */
    --d2-gold: #f3d191;
    --d2-blue: #4a83ff;
    --d2-green: #22c55e;
    --d2-white: #ffffff;
    --d2-grey: #666666;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow: hidden;
}

h1,
h2,
h3,
.logo {
    font-family: 'Exocet', 'Cinzel', serif;
    letter-spacing: 1px;
}

/* Gmail-style Two-Pane Layout */
.gmail-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.gmail-sidebar {
    width: 260px;
    height: 100%;
    background-color: #121216;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 1.5rem 1.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.2rem;
    color: var(--primary);
}

.logo span {
    color: var(--text-main);
    font-size: 0.9em;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
    /* No horizontal padding for Gmail labels */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gmail-main {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Fix flex child overflow */
}

.gmail-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 90;
}

.header-top-row {
    display: grid;
    grid-template-columns: 1fr 350px;
    align-items: center;
    gap: 2rem;
}

.gmail-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background-color: var(--bg-dark);
    background-image: url('/static/bg.png');
    background-repeat: repeat;
    background-size: 300px;
}

/* Sidebar Filters (Gmail Label Style) */
.filters {
    padding: 0 0.5rem;
}

.filter-header h2 {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 0 1.2rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-filter-icons,
.type-filter-grid,
.rarity-filter-icons {
    display: flex;
    flex-direction: column;
}

.icon-toggle,
.checkbox-btn {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 1.2rem;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 1rem;
}

.icon-toggle input,
.checkbox-btn input {
    position: absolute;
    opacity: 0;
}

.icon-toggle:hover,
.checkbox-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.icon-toggle:has(input:checked),
.checkbox-btn:has(input:checked) {
    background: rgba(201, 162, 77, 0.15);
    color: var(--primary);
    font-weight: 700;
}

.icon-toggle i,
.checkbox-btn i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

/* Search Bar */
.search-area {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-dim);
    font-size: 0.8rem;
}

#search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    background: #1e1e24;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Stats Overview */
.stats-overview .stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.stat-progress-bar {
    height: 4px;
    background: #1e1e24;
    border-radius: 2px;
    overflow: hidden;
}

.stat-progress-bar .progress {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}

/* Rune Grid Area */
.runes-area {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.runes-ctrl {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-shrink: 0;
}

.rune-help-compact {
    font-size: 0.6rem;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
}

.rune-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
}

.rune-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 44px;
    cursor: pointer;
    transition: var(--transition);
}

.rune-item .rune-icon {
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rune-item .rune-name {
    font-size: 0.65rem;
    color: #e6b17e;
}

.rune-item:hover {
    border-color: var(--primary);
    background: rgba(201, 162, 77, 0.1);
}

.rune-item.included {
    background: rgba(6, 78, 59, 0.3);
    border-color: #10b981;
}

.rune-item.excluded {
    background: rgba(139, 0, 0, 0.2);
    border-color: #ef4444;
    opacity: 0.6;
}

/* Buttons */
.text-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

/* Runeword Grid */
.runeword-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.runeword-card {
    background: #000000;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border-left: 3px solid #b91c1c;
    /* Default Red border on the left */
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.02);
}

.runeword-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.runeword-card.completed {
    border-left: 3px solid #10b981;
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.8rem;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.runeword-card h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin: 0;
}

.info-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.info-btn:hover {
    color: var(--primary);
    transform: scale(1.2);
}

.patch-badge {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.75rem;
}

.lvl-badge {
    color: var(--primary);
    font-weight: 700;
}

.ladder-badge {
    color: #e6b17e;
    font-style: italic;
    font-size: 0.7rem;
}

.card-runes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.rune-name-small {
    color: var(--d2-gold);
    font-size: 0.85rem;
    font-weight: 600;
}

.rune-arrow {
    color: var(--d2-grey);
    font-size: 0.7rem;
}

.lvl-req {
    color: var(--d2-white);
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.card-sep {
    border-top: 1px solid #333;
    width: 60%;
    margin: 0 auto 1rem auto;
}

.card-bases {
    color: var(--d2-white);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-bases b {
    color: #fff;
    font-weight: 700;
}

.card-stats {
    list-style: none;
    font-size: 0.85rem;
    color: var(--d2-blue);
    line-height: 1.4;
    padding: 0;
    margin-bottom: 1.5rem;
}

.card-stats li {
    margin-bottom: 0.2rem;
}

.card-stats li::before {
    content: none;
}

.stat-range {
    color: var(--d2-green);
    border-bottom: 1px dashed rgba(34, 197, 94, 0.4);
    font-family: 'Inter', monospace;
}

/* Card Badge Statuses */
.card-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-rotw {
    color: #f472b6;
}

/* Pinkish for RotW */
.badge-ladder {
    color: #fcd34d;
}

.badge-version {
    color: #4ade80;
}

.badge-icon {
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sidebar-logo {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.main-logo {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-footer .text-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}