/* ========== RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores do tema - Refinado */
    --primary-green: #2F6B4A;
    --dark-green: #0a1f11;
    /* Mais profundo */
    --lighter-green: #46C16B;
    --accent-green: #3da591;
    /* Verde solicitado */

    /* Raridades */
    --mythic: #FF6B35;
    --rare: #FFD700;
    --uncommon: #C0C0C0;
    --common: #000000;

    --bg-dark: #050d07;
    /* Quase preto */
    --bg-card: #0F2E1A;
    --text-white: #F0F4F2;
    /* Branco levemente off-white */
    --text-gray: #8A9BA8;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 30, 25, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle at top right, #11291b 0%, #020503 100%);
    color: var(--text-white);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    /* Um pouco mais larga para elegância */
    background: rgba(5, 15, 10, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    /* Remover background-image direto para usar pseudo-elemento */
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--sidebar-bg);
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    /* Restaurado */
    opacity: 0.15;
    /* Reduzido para ser sutil */
    mix-blend-mode: overlay;
    /* Restaurado para mesclar melhor */
    z-index: 0;
    transition: background-image 0.5s ease-in-out;
    pointer-events: none;
}

/* FIX: Dropdown options dark */
select option {
    background: #1e1e1e;
    color: #fff;
}

.sidebar-header,
.sidebar-nav {
    position: relative;
    z-index: 1;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.logo {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

.beta-badge {
    background: var(--accent-green);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-section {
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(61, 165, 145, 0.1);
    border-left: none;
    /* Remover borda grossa antiga */
    color: var(--accent-green);
    box-shadow: 0 4px 12px rgba(61, 165, 145, 0.05);
}

.nav-icon,
.set-icon {
    font-size: 18px;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.add-collection-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.add-collection-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-green);
}

/* ========== PESQUISAS SALVAS ========== */
.nav-section-title {
    font-size: 11px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding: 0 10px;
}

.saved-searches-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.saved-searches-list::-webkit-scrollbar {
    width: 4px;
}

.saved-searches-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.saved-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.saved-search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.saved-search-item.active {
    background: rgba(92, 246, 139, 0.2);
    border-left: 3px solid var(--accent-green);
}

.search-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-search-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    opacity: 0;
    transition: all 0.3s;
}

.saved-search-item:hover .delete-search-btn {
    opacity: 1;
}

.delete-search-btn:hover {
    color: #FF6B6B;
}

.add-search-btn {
    width: 100%;
    padding: 10px;
    background: var(--accent-green);
    border: none;
    border-radius: 8px;
    color: var(--dark-green);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-search-btn:hover {
    background: var(--lighter-green);
    transform: translateY(-2px);
}

/* ========== FORM ELEMENTS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-white);
}

.form-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-gray);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-white);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

.help-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.5;
    font-style: italic;
}

.current-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.filters-display {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 12px;
    background: rgba(92, 246, 139, 0.2);
    border: 1px solid var(--accent-green);
    border-radius: 16px;
    font-size: 12px;
    color: var(--accent-green);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== HEADER ========== */
.header {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.collection-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(92, 246, 139, 0.3);
}

.collection-icon img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
}

.collection-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.collection-meta {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stats-counters {
    display: flex;
    gap: 15px;
}

.counter {
    text-align: center;
    min-width: 70px;
}

.counter-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.counter.mythic .counter-value {
    color: var(--mythic);
}

.counter.rare .counter-value {
    color: var(--rare);
}

.counter.uncommon .counter-value {
    color: var(--uncommon);
}

.counter.common .counter-value {
    color: var(--text-gray);
}

.counter-label {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== BARRA DE PROGRESSO GERAL - PREMIUM ========== */
.overall-progress-container {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(27, 78, 45, 0.2));
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.overall-progress-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(92, 246, 139, 0.1), transparent);
    animation: scan 3s infinite;
}

@keyframes scan {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.overall-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.progress-stats {
    font-size: 15px;
    color: var(--text-gray);
    font-weight: 600;
}

.progress-percentage {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-green);
    margin-left: 10px;
    text-shadow: 0 0 10px rgba(92, 246, 139, 0.5);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(61, 165, 145, 0.5);
    }

    50% {
        text-shadow: 0 0 20px rgba(61, 165, 145, 0.8);
    }
}

.overall-progress-bar {
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(61, 165, 145, 0.3);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.overall-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 20px 20px 0 0;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(135deg,
            #153e35 0%,
            #2a7566 25%,
            #3da591 50%,
            #2a7566 75%,
            #153e35 100%);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    position: relative;
    box-shadow:
        0 0 20px rgba(61, 165, 145, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.overall-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.overall-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 20px 20px 0 0;
}

.progress-text {
    font-size: 16px;
    font-weight: 900;
    color: #FFFFFF;
    z-index: 1;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

/* ========== FILTERS BAR ========== */
.filters-bar {
    background: rgba(0, 0, 0, 0.15);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input {
    width: 300px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
}

.search-input::placeholder {
    color: var(--text-gray);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.1);
}

.filter-select {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    cursor: pointer;
    font-size: 14px;
}

/* Opções do select com fundo branco e texto escuro */
.filter-select option {
    background: #FFFFFF;
    color: #000000;
    padding: 10px;
}

.filter-input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 14px;
}

/* Opções dos filtros avançados também com contraste */
.filter-input option {
    background: #FFFFFF;
    color: #000000;
    padding: 8px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-gray);
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.total-cards {
    font-size: 14px;
    color: var(--text-gray);
}

.total-cards span {
    color: var(--text-white);
    font-weight: 600;
}

/* ========== BOTÕES DE AÇÃO ========== */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-action {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-white);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover {
    background: rgba(92, 246, 139, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-1px);
}

.btn-action.primary {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #05140a;
    font-weight: 600;
}

.btn-action.primary:hover {
    background: var(--lighter-green);
    border-color: var(--lighter-green);
    box-shadow: 0 0 15px rgba(92, 246, 139, 0.3);
}

/* Input file invisível */
input[type="file"] {
    display: none;
}

/* ========== FILTROS AVANÇADOS ========== */
.advanced-filters {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    display: none;
}

.advanced-filters.active {
    display: block;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-group-adv {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-label {
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 14px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-green);
}

.toggle-filters-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 13px;
}

.toggle-filters-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========== BOTÕES DAS COLUNAS ========== */
.column-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-column {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-column:hover {
    background: var(--accent-green);
    color: var(--dark-green);
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--dark-green);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-small {
    max-width: 400px;
}

/* Modal com Background da Carta */
.modal-backdrop-card {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999;
}

.modal-card-dark {
    max-width: 850px;
    width: 95%;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 1000;
}

.modal-close-dark {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close-dark:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.card-modal-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
}

.card-modal-image {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    background: rgba(0, 0, 0, 0.95);
}

.card-modal-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.card-modal-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #fff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 20px;
    border-radius: 0 12px 12px 0;
    overflow: hidden;
}

.card-modal-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 0;
}

.card-modal-info>* {
    position: relative;
    z-index: 1;
}

.card-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-field {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-icon {
    font-size: 16px;
    width: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0.7;
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.info-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.info-data {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
}

.info-data i.ms {
    font-size: 16px;
    margin-right: 2px;
}

.info-oracle,
.info-flavor {
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.info-oracle::-webkit-scrollbar,
.info-flavor::-webkit-scrollbar {
    width: 4px;
}

.info-oracle::-webkit-scrollbar-track,
.info-flavor::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.info-oracle::-webkit-scrollbar-thumb,
.info-flavor::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.info-flavor {
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
}

.card-modal-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s;
}

.modal-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.modal-link span:first-child {
    font-size: 14px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 25px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.export-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--accent-green);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-green);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked+span {
    color: var(--accent-green);
    font-weight: 600;
}

.radio-option span {
    font-size: 14px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* ========== CARDS CONTAINER ========== */
.cards-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    /* Reduzido de 20px 30px */
}

.cards-container::-webkit-scrollbar {
    width: 8px;
}

.cards-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.cards-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.cards-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== CARDS GRID - TRÊS COLUNAS ========== */
.cards-grid-container-three {
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    /* Reduzido de 300px para 240px */
    gap: 15px;
    /* Reduzido de 20px */
    padding: 0;
}

.collections-column {
    display: flex;
    flex-direction: column;
}

.collections-list {
    overflow-y: auto;
    max-height: calc(100vh - 400px);
}

.collections-list::-webkit-scrollbar {
    width: 6px;
}

.collections-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.collections-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.collection-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.collection-item.active {
    background: rgba(61, 165, 145, 0.1);
    border-color: var(--accent-green);
    box-shadow: 0 4px 12px rgba(61, 165, 145, 0.1);
}

.collection-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.collection-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.collection-name {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-white);
}

.collection-stats {
    font-size: 11px;
    color: var(--text-gray);
    display: flex;
    justify-content: space-between;
}

.collection-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.collection-progress-fill {
    height: 100%;
    background: var(--accent-green);
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--accent-green);
}

.cards-column {
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
    border-radius: 12px 12px 0 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.column-info {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    /* Garante que ícone, título e contador fiquem na mesma linha */
}

.column-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: 0.5px;
}

.column-count {
    font-size: 12px;
    color: var(--text-gray);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== ABAS DA COLUNA FALTANTES ========== */
.missing-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 12px 0 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.missing-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
}

.missing-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.3s ease;
}

.missing-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.missing-tab.active {
    background: rgba(61, 165, 145, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 -2px 8px rgba(61, 165, 145, 0.2);
}

.missing-tab.active::after {
    background: var(--accent-green);
}

.tab-icon {
    font-size: 16px;
    opacity: 0.8;
}

.missing-tab.active .tab-icon {
    opacity: 1;
}

.tab-text {
    flex: 1;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.missing-tab.active .tab-count {
    background: var(--accent-green);
    color: var(--dark-green);
}

/* ========== ABAS DA COLUNA POSSUÍDAS ========== */
.owned-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 12px 0 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.owned-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
}

.owned-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.3s ease;
}

.owned-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.owned-tab.active {
    background: rgba(61, 165, 145, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 -2px 8px rgba(61, 165, 145, 0.2);
}

.owned-tab.active::after {
    background: var(--accent-green);
}

.owned-tab.active .tab-icon {
    opacity: 1;
}

.owned-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.owned-tab.active .tab-count {
    background: var(--accent-green);
    color: var(--dark-green);
}

/* ========== CONTROLES DE MARCAÇÃO EM MASSA ========== */
.bulk-mark-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.bulk-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-white);
}

.bulk-select {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-white);
    cursor: pointer;
    font-size: 11px;
    min-width: 120px;
    max-width: 180px;
}

.bulk-select option {
    background: #FFFFFF;
    color: #000000;
}

.bulk-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.bulk-separator {
    font-size: 12px;
    color: var(--text-gray);
}

.bulk-mark-btn {
    margin-left: auto;
}



.btn-sort {
    padding: 6px 10px;

    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s;
    min-width: 32px;
}

.btn-sort:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sort.active {
    background: rgba(61, 165, 145, 0.1);
    /* Verde solicitado */
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.btn-action-sm {
    padding: 4px 8px;
    /* Reduzido de 6px 12px */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 10px;
    /* Reduzido de 11px */
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-action-sm:hover {
    background: rgba(61, 165, 145, 0.1);
    color: var(--accent-green);
    border-color: rgba(61, 165, 145, 0.3);
    transform: translateY(-1px);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Sempre 3 colunas fixas, minmax evita overflow */
    gap: 12px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Quando há filtro ativo, mostrar uma coluna só */
.cards-grid.single-column {
    grid-column: 1 / -1;
}

.card-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========== CARTAS OVERSIZE ========== */
.card-item.oversize-card {
    border: 2px solid #ff6b35;
    /* Borda laranja/vermelha para destaque */
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

.oversize-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    z-index: 15;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}


.card-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-green);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-green);
    z-index: 10;
}

.card-item.owned {
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.5);
    /* Borda verde sólida para owned */
}

/* Owned hover override */
.card-item.owned:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--accent-green);
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 5/7;
    background: rgba(0, 0, 0, 0.5);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s;
}

.card-item.not-owned .card-image {
    filter: grayscale(100%) brightness(0.6);
}

.card-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
}

.card-buy-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.card-buy-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent-green);
    transform: scale(1.1);
}

.card-buy-btn.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    opacity: 1;
    box-shadow: 0 0 15px rgba(61, 165, 145, 0.6);
}

.card-buy-btn.active:hover {
    background: var(--lighter-green);
}

.card-print-btn {
    position: absolute;
    top: 48px;
    /* Abaixo do botão de compras */
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.card-print-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
    border-color: #9966ff;
    /* Cor roxa para diferençar */
    transform: scale(1.1);
}

.card-print-btn.active {
    background: #9966ff;
    /* Roxo */
    border-color: #9966ff;
    opacity: 1;
    box-shadow: 0 0 15px rgba(153, 102, 255, 0.6);
}

.card-print-btn.active:hover {
    background: #bb99ff;
    /* Roxo claro */
}



.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.card-item:hover .card-overlay {
    transform: translateY(0);
}

.card-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-set {
    font-size: 10px;
    color: var(--text-gray);
}

/* ========== LOADING ========== */
.loading {
    text-align: center;
    padding: 40px;
}

.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========== RESPONSIVE ========== */
/* Action Bar - Base */
.collection-actions-bar {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

/* Desktop Only Improvements */
@media (min-width: 769px) {
    .collection-actions-bar {
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 15px 25px;
        backdrop-filter: blur(10px);
        margin-bottom: 30px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        grid-column: 1 / -1;
        /* Span full width if in grid */
    }

    .collection-actions-bar .btn-action-sm {
        font-size: 13px;
        font-weight: 600;
        padding: 10px 20px;
        border-radius: 8px;
        min-height: 42px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #e0e0e0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

    .collection-actions-bar .btn-action-sm:hover {
        background: var(--accent-green);
        color: var(--dark-green);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(61, 165, 145, 0.4);
        border-color: var(--accent-green);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }

    .sidebar span:not(.logo):not(.beta-badge) {
        display: none;
    }
}

/* Mobile Toggle - Hidden on Desktop */
.menu-toggle {
    display: none;
}

.mobile-tabs {
    display: none;
}

@media (max-width: 768px) {

    /* Sidebar Drawer */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--border-color);
        background-color: var(--bg-dark);
        /* Fallback se imagem falhar */
    }

    .sidebar.active {
        left: 0;
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
    }

    /* Header e Menu Button */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 1px solid var(--border-color);
        color: var(--text-white);
        font-size: 20px;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        margin-right: 10px;
    }

    /* Actions Bar */
    .collection-actions-bar {
        display: flex;
        gap: 8px;
        padding: 10px 5px;
        /* Mais espaço vertical */
        margin-bottom: 12px;
        overflow-x: visible;
        /* Sem scroll */
        justify-content: space-between;
        width: 100%;
        flex-wrap: nowrap;
    }

    .collection-actions-bar .btn-action-sm {
        white-space: nowrap;
        flex: 1;
        flex-shrink: 1;
        padding: 4px 1px;
        font-size: 9px;
        height: auto;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 4px;
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 10px 15px;
    }

    .header-left {
        gap: 5px;
    }

    .collection-title {
        font-size: 16px;
    }

    .collection-meta {
        font-size: 10px;
    }

    .stats-counters {
        display: none;
        /* Esconder contadores detalhados no header mobile para economizar espaço? Ou reduzir? */
        /* Vamos manter hidden por enquanto e confiar no "Total" lá embaixo ou simplificar */
    }

    /* Filters Mobile */
    .filters-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .search-container,
    .search-input {
        width: 100%;
    }

    .filters-actions,
    .filters-right {
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
        /* Permitir quebra se necessário */
    }

    .filters-left {
        flex-wrap: wrap;
    }

    .checkbox-label {
        font-size: 11px;
        /* Fonte menor para caber */
    }

    /* Tabs Mobile */
    .mobile-tabs {
        display: flex;
        gap: 8px;
        margin: 10px 0;
        padding: 4px;
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        width: 100%;
        flex-shrink: 0;
        overflow: hidden;
        /* Evitar scrollbar */
    }

    .tab-btn {
        flex: 1;
        padding: 10px;
        background: transparent;
        border: none;
        color: var(--text-gray);
        font-weight: 600;
        font-size: 13px;
        border-radius: 8px;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
    }

    .tab-btn.active {
        background: var(--accent-green);
        color: var(--dark-green);
        box-shadow: 0 4px 12px rgba(61, 165, 145, 0.3);
    }

    /* Ajustes para Headers de Coluna no Mobile */
    .column-header .header-row {
        flex-wrap: wrap;
        gap: 5px;
    }

    .column-header .column-info {
        max-width: 100%;
        flex-grow: 1;
    }

    .column-header .header-actions {
        /* Se não couber, vai para linha de baixo e ocupa tudo */
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 5px;
    }

    .column-header .btn-action-sm {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* Grid transformado em Abas e Layout Horizontal */
    .cards-grid-container-three {
        display: contents;
    }

    .cards-container {
        display: flex;
        flex-direction: column;
    }

    /* Ordem dos elementos no Mobile */
    .collection-actions-bar {
        order: 1;
    }

    #colCollections {
        order: 2;
    }

    .mobile-tabs {
        order: 3;
    }

    #colMissing,
    #colOwned {
        order: 4;
    }

    /* Coleções - Horizontal Scroll */
    #colCollections {
        display: flex !important;
        /* Sempre visível */
        width: 100%;
        flex-direction: column;
        margin-bottom: 15px;
    }

    #colCollections .column-header {
        padding: 5px 10px;
        margin-bottom: 5px;
    }

    #colCollections #collectionsListtext {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    /* Item compacto para caber ~5 na tela (largura ~70-75px) */
    #colCollections .collection-item {
        min-width: 72px;
        width: 72px;
        padding: 6px 4px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
        flex-shrink: 0;
    }

    #colCollections .collection-header {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 2px;
        width: 100%;
        justify-content: center;
    }

    #colCollections .collection-icon {
        width: 28px;
        height: 28px;
        margin: 0;
    }

    #colCollections .collection-name {
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.2;
    }

    #colCollections .collection-stats {
        font-size: 9px;
        justify-content: center;
        gap: 2px;
    }

    #colCollections .collection-progress-bar {
        height: 3px;
        margin-top: 2px;
    }

    /* Colunas Ocultáveis (Faltantes/Possuídas) */
    #colMissing,
    #colOwned {
        display: none;
        width: 100%;
    }

    #colMissing.active-column,
    #colOwned.active-column {
        display: flex;
        animation: fadeIn 0.3s ease-out;
    }

    /* Ajustes Grid de Cartas */
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .main-content {
        padding: 10px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.info-oracle i.ms {
    font-size: 1.1em;
}

/* Modal Mobile Fixes */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start;
        /* Permitir scroll */
        padding: 0;
    }

    .modal-content.modal-card-dark {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        margin: 0;
        overflow-y: auto;
        /* Scroll interno */
    }

    .card-modal-layout {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }

    .card-modal-image {
        padding: 20px 0;
        width: 100%;
        background: transparent;
        justify-content: center;
        min-height: auto;
    }

    .card-modal-image img {
        width: 90%;
        /* Ocupar quase todo o espaço lateral */
        max-width: 400px;
        height: auto;
        max-height: none;
        /* Remover limite de altura */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
        margin: 0 auto;
        display: block;
    }

    .card-modal-info {
        padding: 15px;
        width: 100%;
        border-radius: 0;
    }

    .modal-close-dark {
        top: 10px;
        right: 10px;
        position: fixed;
        /* Fixo na tela */
        background: rgba(0, 0, 0, 0.6);
        z-index: 1100;
        width: 36px;
        height: 36px;
    }

    .info-row {
        grid-template-columns: 1fr;
        /* Stack info fields */
        gap: 0;
    }
}

/* ========== CAMERA SCANNER ========== */
.scanner-modal {
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
}

.scanner-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #000;
}

.scanner-view {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scan-area.full-card {
    width: auto;
    height: 65%;
    /* Ocupa 65% da altura da tela */
    aspect-ratio: 63/88;
    /* Proporção Magic Card */
    max-width: 90%;
    border: 3px solid #00ff00;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    /* Darker overlay */
    border-radius: 12px;
    /* Card corners */
    position: relative;
    transition: all 0.3s;
}

/* Remove old specific width/height if needed, or rely on cascade */
.scan-area {
    width: 85%;
    max-width: 400px;
    height: 70px;
    /* Foco no nome */
    border: 3px solid #00ff00;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    position: relative;
}

.scan-area::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 255, 0, 0.3);
}

.camera-controls {
    pointer-events: auto;
    /* Allow interaction */
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#focusRange {
    width: 150px;
    accent-color: #00ff00;
}

.btn-focus {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.scan-instructions {
    margin-top: 25px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 2px 4px #000;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    text-align: center;
}

.scan-status {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 1px 2px #000;
    z-index: 10;
    font-size: 14px;
}

.scanner-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    z-index: 2001;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* ========== SETUP MODAL STYLES ========== */
.setup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, #11291b 0%, #020503 100%);
    /* FIX: Gradient background */
    z-index: 10000;
    /* Above everything */
    padding: 0;
    display: flex;
    /* Ensure flex is set here too */
    align-items: center;
    justify-content: center;
}

.setup-modal .modal-backdrop {
    opacity: 1;
    background-color: #0d1117;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Imagem será definida via JS */
}

.setup-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border-color);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.setup-header {
    text-align: center;
    margin-bottom: 30px;
}

.setup-title {
    font-size: 2rem;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.setup-subtitle {
    color: var(--text-gray);
    font-size: 1rem;
}

.form-section {
    margin-bottom: 25px;
    animation: fadeIn 0.5s ease-out;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
}

.form-select,
.form-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.query-builder {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.dynamic-fields {
    margin-top: 15px;
    display: none;
}

.dynamic-fields.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



.scanner-results {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 30, 0.98);
    padding: 20px;
    border-top: 2px solid var(--accent-green);
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s ease-out;
    max-height: 50%;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.results-header {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.matched-display {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.matched-card-candidate {
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 5px;
    transition: all 0.2s;
}

.matched-card-candidate.selected {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.matched-card-candidate img {
    width: 100%;
    border-radius: 4%;
}

/* ========== MULTI-COLLECTION MANAGER ========== */
.collection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.collection-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.collection-item.active-collection {
    background: rgba(61, 165, 145, 0.15);
    border-left: 3px solid var(--accent-green);
    border-color: rgba(61, 165, 145, 0.2);
}

.collection-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.collection-name {
    font-size: 13px;
    color: var(--text-white);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-date {
    font-size: 10px;
    color: var(--text-gray);
}

.collection-icon-display {
    font-size: 16px;
    margin-right: 10px;
}

/* Startup Modal Collections List */
#startupCollectionsList .collection-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#startupCollectionsList .collection-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    border-color: var(--accent-green);
}

#startupCollectionsList .collection-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e2e8f0;
}

#startupCollectionsList .collection-date {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ========== PROGRESS BAR IN SIDEBAR ========== */
.collection-progress-bar {
    width: 100%;
    height: 4px;
    /* Thin line like in the image */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
    position: relative;
}

.collection-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3da591, #2a7a6b);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Adjust Collection Item Layout for Progress Bar */
.collection-item {
    flex-direction: column !important;
    /* Allow stacking */
    align-items: stretch !important;
    padding: 10px 12px !important;
    gap: 4px !important;
    height: auto !important;
    /* Allow growth */
}

.collection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.collection-stats {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-gray);
    margin-top: 2px;
}

/* Reorder Buttons */
.reorder-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.6rem;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.reorder-btn:hover {
    color: var(--accent-green);
    transform: scale(1.2);
}


#app-view {
    display: none;
    /* Controlled by JS */
    width: 100%;
    height: 100%;
}

#app-view[style*="display: block"] {
    display: flex !important;
}

/* --- LANDING PAGE STYLES --- */
#landing-view {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--landing-bg);
    width: 100%;
    height: 100vh;
    /* Force viewport height */
    overflow: hidden;
    /* Disable scrolling */
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    /* Reduced padding */
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.landing-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.landing-nav {
    display: flex;
    gap: 15px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    padding: 8px 16px;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-primary);
}

.btn-primary-small {
    background: var(--landing-accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary-small:hover {
    background: #7c3aed;
    /* Darker Violet */
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px 10%;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    margin-bottom: 60px;
    /* Space before features section */
}

.hero-content {
    flex: 1;
    max-width: 550px;
}

.hero-content h1 {
    font-size: 3.2rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-cta {
    background: var(--landing-accent);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-cta:hover {
    transform: translateY(-2px);
    background: #7c3aed;
}

.hero-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.7;
}

/* Hero Visual */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.card-stack-visual {
    position: relative;
    width: 320px;
    /* Reduced specific size */
    height: 450px;
    /* Reduced specific size */
}

.card-visual {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-visual.c1 {
    background-image: url('https://cards.scryfall.io/large/front/8/b/8bbcfb77-daa1-4ce5-b5f9-48d0a8edbba9.jpg');
    transform: rotate(-10deg) translate(-40px, 0);
    z-index: 1;
}

.card-visual.c2 {
    background-image: url('https://cards.scryfall.io/large/front/b/d/bd8fa327-dd41-4737-8f19-2cf5eb1f7cdd.jpg');
    transform: rotate(5deg) translate(40px, -20px);
    z-index: 2;
}

.card-visual.c3 {
    background-image: url('https://cards.scryfall.io/large/front/6/6/66605fe1-9a20-4c95-b53e-1249cedb978b.jpg?1675957216');
    transform: rotate(-2deg) translate(0, 20px) scale(1.05);
    z-index: 3;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Features Section */
.features-section {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 20px 10%;
    background: #111;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-top: auto;
    /* Push to bottom */
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 260px;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.landing-footer {
    text-align: center;
    padding: 25px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    background: #000;
}

/* --- AUTH MODALS --- */
.auth-modal .modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.auth-modal h2 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--landing-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        padding: 40px 20px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        margin-top: 40px;
    }

    .card-stack-visual {
        transform: scale(0.8);
    }

    .features-section {
        flex-direction: column;
        padding: 40px 20px;
    }
}