/* Enhanced layout for deck manager - OPTIMIZED SPACE UTILIZATION UPDATE */
/* Updated for compact card layout system - CACHE BUST ACTIVE */

#screen-deck-manager {
    padding-top: 60px;
    /* Account for the top player info bar (height: 60px) */
    box-sizing: border-box;
    /* Ensures padding doesn't add to the total height if height is fixed */
}

/* Deck builder card containers with improved spacing */
.deck-builder-collection-panel .card,
.deck-builder-deck-panel .card {
    width: 90px;
    height: 126px;
    margin: 3px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Enhanced card grid for better organization */
.deck-builder-collection-panel .card-list,
.deck-builder-deck-panel .card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 4px;
    padding: 4px;
}

/* Enhanced layout structure for the three-column view */
.deck-builder-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    height: calc(100vh - 120px);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-sizing: border-box;
}

/* Responsive three column layout with improved proportions */
@media (min-width: 1024px) {
    .deck-builder-layout {
        grid-template-columns: 1.5fr 1fr 1fr; /* Collection gets more space for better filtering */
        gap: 16px;
        padding: 16px;
    }
}

@media (min-width: 1400px) {
    .deck-builder-layout {
        grid-template-columns: 1.7fr 1fr 1.1fr; /* Optimal proportions - collection largest, info panel compact */
        gap: 18px;
        padding: 18px;
    }
}

@media (min-width: 1600px) {
    .deck-builder-layout {
        grid-template-columns: 1.8fr 1fr 1.2fr; /* Extra wide screens get even better proportions */
        gap: 20px;
        padding: 20px;
    }
}

/* Ensure equal height for all panels */
.deck-builder-collection-panel,
.deck-builder-deck-panel,
.deck-builder-info-panel {
    min-height: 0; /* Allow flexbox to shrink */
    display: flex;
    flex-direction: column;
}

/* Enhanced panel styling with better visual hierarchy */
.deck-builder-collection-panel,
.deck-builder-deck-panel,
.deck-builder-info-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}

/* Panel content areas that can scroll */
.deck-builder-collection-panel .card-list,
.deck-builder-deck-panel .card-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 8px;
    padding-right: 6px;
    max-height: calc(100vh - 280px);
}

/* Custom scrollbar for panels */
.deck-builder-collection-panel .card-list::-webkit-scrollbar,
.deck-builder-deck-panel .card-list::-webkit-scrollbar {
    width: 8px;
}

.deck-builder-collection-panel .card-list::-webkit-scrollbar-track,
.deck-builder-deck-panel .card-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.deck-builder-collection-panel .card-list::-webkit-scrollbar-thumb,
.deck-builder-deck-panel .card-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.deck-builder-collection-panel .card-list::-webkit-scrollbar-thumb:hover,
.deck-builder-deck-panel .card-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Enhanced panel headers */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
}

/* Enhanced typography with better hierarchy */
.panel-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.collection-stats {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: normal;
}

/* Redesigned Filter Pills with Clear Toggle States */
.quick-filters {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 8px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-type-filter-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: auto;
}

.card-type-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.card-type-filter-btn.active {
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.3) 0%, rgba(74, 119, 190, 0.25) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(100, 149, 237, 0.3);
    font-weight: 600;
}

/* Streamlined Collection Controls */  
.collection-controls {
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Advanced search bar */
.advanced-search-container {
    position: relative;
    margin-bottom: 16px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    display: inline-block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%23c9a84c' stroke-width='2'/%3E%3Cline x1='15.5' y1='15.5' x2='21' y2='21' stroke='%23c9a84c' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
    opacity: 0.7;
}

.advanced-search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #ffffff;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.advanced-search-input:focus {
    outline: none;
    border-color: rgba(100, 149, 237, 0.8);
    box-shadow: 0 0 0 4px rgba(100, 149, 237, 0.2), 0 8px 24px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
}

.advanced-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Search suggestions dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95) 0%, rgba(30, 30, 40, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-top: 4px;
    display: none;
}

.search-suggestions.show {
    display: block;
}

.search-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
}

.search-suggestion-icon {
    font-size: 14px;
    opacity: 0.7;
}

.search-suggestion-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

/* Quick filters row */
.quick-filters-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-filter-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    white-space: nowrap;
}

.quick-filter-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-filter-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quick-filter-btn.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(74, 144, 226, 0.4);
}

.quick-filter-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.6);
}

/* Multi-criteria filters */
.multi-criteria-filters {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.filter-criteria-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.filter-criteria-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.filter-toggle-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.filter-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-dropdown,
.filter-range-input {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.filter-dropdown:focus,
.filter-range-input:focus {
    outline: none;
    border-color: rgba(100, 149, 237, 0.8);
    box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
}

.filter-dropdown:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(100, 149, 237, 0.4);
}

.filter-dropdown option {
    background: rgba(20, 20, 30, 0.95);
    color: #ffffff;
    padding: 8px 12px;
    border: none;
}

/* Clear filters button */
.clear-filters-btn {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(233, 30, 99, 0.2) 100%);
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 8px;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-filters-btn:hover {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.3) 0%, rgba(233, 30, 99, 0.3) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.search-row {
    position: relative;
    margin-bottom: 12px;
}

#collection-search {
    width: 100%;
    padding: 10px 40px 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

#collection-search:focus {
    outline: none;
    border-color: rgba(100, 149, 237, 0.5);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.2);
}

#collection-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Gear icon integrated in search bar */
#advanced-filters-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#advanced-filters-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) rotate(90deg);
}

#advanced-filters-toggle:active {
    transform: translateY(-50%) rotate(180deg) scale(0.95);
}

/* Advanced filters dropdown */
.advanced-filters {
    background: rgba(15, 18, 30, 0.95);
    border-radius: 6px;
    padding: 8px;
    margin-top: 6px;
    border: 1px solid rgba(100, 149, 237, 0.3);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row select,
.filter-row input {
    flex: 1;
    padding: 4px 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 0.8em;
    min-width: 70px;
    transition: all 0.2s ease;
}

.filter-row select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 24px;
}

.filter-row select:focus,
.filter-row input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.filter-row select:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: rgba(100, 149, 237, 0.4);
}

.filter-row select option {
    background: rgba(20, 20, 30, 0.95);
    color: white;
    padding: 6px 8px;
    border: none;
}

.filter-row input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8em;
}

.clear-btn {
    padding: 6px 10px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: rgba(244, 67, 54, 0.4);
}

.sort-and-view {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sort-and-view select {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 0.85em;
    min-width: 120px;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.sort-and-view select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
}

.sort-and-view select:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(100, 149, 237, 0.4);
}

.sort-and-view select option {
    background: rgba(20, 20, 30, 0.95);
    color: white;
    padding: 8px 12px;
    border: none;
}

/* Deck Panel Enhancements */
.deck-count-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.deck-count-text {
    font-weight: bold;
    font-size: 1.1em;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Deck count state styling */
.deck-count-text.deck-empty {
    background: rgba(158, 158, 158, 0.2);
    border-color: rgba(158, 158, 158, 0.4);
    color: #9e9e9e;
}

.deck-count-text.deck-partial {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
    color: #ff9800;
    animation: pulse-warning 2s infinite;
}

.deck-count-text.deck-full {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
    color: #4caf50;
}

.deck-count-text.deck-overfull {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #f44336;
    animation: pulse-error 1.5s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-error {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(244, 67, 54, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 8px rgba(244, 67, 54, 0.6); }
}

.deck-status-indicators {
    display: flex;
    gap: 4px;
}

.status-indicator {
    font-size: 1.2em;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.status-indicator:hover {
    opacity: 1;
}

.deck-controls {
    margin-bottom: 10px;
}

.deck-view-and-sort {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.deck-view-options {
    display: flex;
    gap: 4px;
}

.view-button {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-button.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.3);
}

.deck-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.secondary-button {
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.secondary-button:active {
    transform: translateY(0);
}

/* Right panel structure to properly position mana curve */
.deck-builder-info-panel {
    display: flex;
    flex-direction: column;
}

/* Collapsible Deck Details with Accordion Style */
.deck-customization {
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.deck-customization h3 {
    margin: 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s ease;
}

.deck-customization h3:hover {
    background: rgba(255, 255, 255, 0.08);
}

.deck-customization h3::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.deck-customization.collapsed h3::after {
    transform: rotate(-90deg);
}

.deck-customization-content {
    padding: 16px;
    max-height: 500px;
    transition: all 0.3s ease;
}

.deck-customization.collapsed .deck-customization-content {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.deck-details-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.deck-detail-group {
    flex: 1;
}

.deck-detail-group.full-width {
    flex: 1 1 100%;
}

.deck-customization label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
}

.deck-customization input,
.deck-customization textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.3);
    color: inherit;
    font-size: 0.9em;
    transition: border-color 0.2s ease;
}

.deck-customization input:focus,
.deck-customization textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* Enhanced deck statistics section */
.deck-stats-section {
    margin-bottom: 10px;
}

.deck-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.stat-overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.stat-label {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-weight: bold;
    font-size: 0.8em;
}

/* Redesigned Aether Curve Visualization */
.deck-analysis-preview {
    margin: 10px 0;
    padding: 8px;
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.6) 0%, rgba(20, 25, 40, 0.4) 100%);
    border-radius: 6px;
    border: 1px solid rgba(100, 149, 237, 0.2);
    position: relative;
    overflow: hidden;
}

.deck-analysis-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(100, 149, 237, 0.5) 50%, transparent 100%);
}

.deck-analysis-preview h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

/* Enhanced Aether Curve Display */
#aether-curve-display {
    background: radial-gradient(ellipse at bottom, rgba(100, 149, 237, 0.1) 0%, transparent 70%);
    border-radius: 6px;
    padding: 12px 10px 16px;
    margin-bottom: 6px;
    min-height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    border: 1px solid rgba(100, 149, 237, 0.15);
    position: relative;
}

#aether-curve-display::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 10px;
    right: 10px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Modern Aether Curve Bars */
.aether-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 8%;
    min-width: 20px;
    max-width: 40px;
    position: relative;
    cursor: pointer;
    padding: 0 2px;
}

.aether-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, rgba(100, 149, 237, 0.9) 0%, rgba(74, 119, 190, 0.7) 100%);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 4px;
    position: relative;
    box-shadow: 0 -2px 8px rgba(100, 149, 237, 0.3);
}

.aether-bar:hover .aether-bar-fill {
    background: linear-gradient(180deg, rgba(100, 149, 237, 1) 0%, rgba(74, 119, 190, 0.8) 100%);
    box-shadow: 0 -4px 12px rgba(100, 149, 237, 0.5);
    transform: scaleY(1.05);
}

.aether-bar-fill {
    background: linear-gradient(to top, #4a90e2 0%, #6bb6ff 100%);
    width: 100%;
    border-radius: 4px;
    transition: height 0.3s ease;
    min-height: 4px;
}

.aether-bar-label {
    position: absolute;
    bottom: -18px;
    font-size: 11px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    white-space: nowrap;
}

.aether-bar-count {
    position: absolute;
    top: -22px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(20, 24, 37, 0.9) 0%, rgba(15, 18, 30, 0.95) 100%);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    border: 1px solid rgba(100, 149, 237, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.aether-bar:hover .aether-bar-count {
    opacity: 1;
}

/* Enhanced deck stats section */
.deck-stats-display {
    margin-top: 10px;
}

.deck-stats-display h4 {
    margin-bottom: 6px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

#deck-stats-types,
#deck-stats-rarities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.stat-badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.stat-badge:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-1px);
}

.stat-badge-count {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    font-size: 0.7em;
    font-weight: bold;
    color: white;
}