:root {
    --bg-color-main: #0f111a;
    --panel-bg: rgba(25, 28, 41, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary-glow: #6366f1;
    --accent-color: #0ea5e9;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --success-color: #10b981;
}

body {
    background-color: var(--bg-color-main);
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-outfit {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-row {
    flex: 1;
    min-height: 0;
}

.glass-panel {
    background: rgba(15, 17, 26, 0.5); /* More transparent to see BG */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.app-header {
    animation: glow-pulse 4s infinite alternate;
}

@keyframes glow-pulse {
    0% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 0 10px rgba(99, 102, 241, 0.1); }
    100% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 0 25px rgba(14, 165, 233, 0.4); }
}

.gradient-text {
    background: linear-gradient(135deg, #a8b1ff, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.custom-input {
    background: rgba(15, 17, 26, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.custom-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
    border-color: var(--primary-glow) !important;
}

.search-container {
    position: relative;
    z-index: 1050;
}

.btn-search {
    background: linear-gradient(135deg, var(--primary-glow), var(--accent-color));
    color: white;
    border: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    color: white;
}

.results-container, .deck-lists {
    overflow-y: auto;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Card Results */
.card-result {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.card-img-rounded {
    border-radius: 4.75% / 3.5%;
}

.card-result img {
    border-radius: 4.75% / 3.5%;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.card-result:hover {
    transform: scale(1.05) translateY(-5px);
    z-index: 10;
}

.card-result:hover img {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    padding: 15px 10px 10px;
    border-bottom-left-radius: 4.75% / 3.5%;
    border-bottom-right-radius: 4.75% / 3.5%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-result:hover .card-overlay {
    opacity: 1;
}

.card-price {
    font-weight: 700;
    color: var(--success-color);
    text-shadow: 1px 1px 2px black;
}

/* Decklist Items */
.deck-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.deck-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.deck-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    transition: color 0.2s ease;
}

.deck-item-info {
    transition: transform 0.2s ease;
}

.deck-item-info:hover {
    transform: translateX(4px);
}

.deck-item-info:hover .deck-item-name {
    color: var(--accent-color);
}

.deck-item-price {
    color: var(--success-color);
    font-size: 0.85rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-qty {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0 4px;
    cursor: pointer;
    line-height: 1;
}

.btn-qty:hover {
    color: white;
}

.stats-panel {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.add-btns {
    display: flex;
    gap: 5px;
}

/* Flying Card Animation */
.flying-card {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border-radius: 4.75% / 3.5%;
}

/* Modal specific */
#deckModal .modal-content {
    border: 1px solid var(--panel-border);
}
#deckModal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Autocomplete */
.autocomplete-item {
    color: var(--text-main);
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

/* Brand Link */
.brand-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 14px 6px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255, 157, 0, 0.15);
}

.brand-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 157, 0, 0.1);
    border-color: rgba(255, 157, 0, 0.4);
    box-shadow: 0 4px 15px rgba(255, 157, 0, 0.15);
}

.brand-logo {
    height: 32px !important;
    max-width: 150px;
    width: auto !important;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.brand-text {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ff9d00, #ff5e00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(255, 94, 0, 0.1);
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 991px) {
    .app-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }

    .brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .actions {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 10px !important;
    }

    .brand-link {
        margin-top: 10px !important;
    }
}

@media (max-width: 767px) {
    .app-container {
        height: auto !important;
        min-height: 100vh;
    }

    .layout-row {
        flex-direction: column;
        gap: 20px;
    }

    .results-container {
        min-height: 400px;
        max-height: 50vh;
    }

    .deck-sidebar {
        min-height: 500px;
        max-height: 70vh;
    }

    .card-result:hover {
        transform: scale(1.02) translateY(-2px);
    }
    
    .card-overlay {
        opacity: 1 !important;
        background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
        padding: 8px 5px 5px;
    }
    
    .add-btns .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .deck-item-name {
        max-width: 120px;
    }

    .login-panel {
        padding: 2rem !important;
    }
}
