:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    --val-bg: rgba(15, 23, 42, 0.5);
    --val-border: rgba(255, 255, 255, 0.05);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Animations */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: #4c1d95;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: #0f766e;
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: #be185d;
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 100px) scale(1.1);
    }
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
}

/* Top Controls Container */
.top-controls {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

/* Language Selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    backdrop-filter: blur(10px);
}

.lang-selector svg {
    color: var(--text-secondary);
}

#langSelect {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

#langSelect option {
    background: var(--bg-dark);
}

/* Calculator Toggle Button */
.calc-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: var(--transition);
}

.calc-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

header {
    text-align: center;
    margin-bottom: 4rem;
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

h1 span {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    backdrop-filter: blur(12px);
    outline: none;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    background: rgba(30, 41, 59, 0.8);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 2rem;
}

.cat-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.cat-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.cat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Sorting */
.sort-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.sort-container label {
    font-weight: 600;
    color: var(--text-secondary);
}

#sortSelect {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    backdrop-filter: blur(12px);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

#sortSelect:focus {
    border-color: var(--accent);
    background: rgba(30, 41, 59, 0.9);
}

/* Grid */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.pet-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.pet-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.pet-card img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.pet-card:hover img {
    transform: scale(1.1);
}

.pet-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.pet-rarity {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
}

.pet-rarity.uncommon {
    color: #10b981;
}

.pet-rarity.rare {
    color: #3b82f6;
}

.pet-rarity.ultra-rare {
    color: #f59e0b;
}

.pet-rarity.legendary {
    color: #a78bfa;
}

/* Add to Offer Controls in Modal */
.add-offer-controls {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.offer-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.offer-btn.my-offer {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.offer-btn.their-offer {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.offer-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

/* Calculator Panel (Elvebredd Style) */
.calculator-panel {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    background: #0f172a;
    /* Deep navy background */
    border: 2px solid #1e293b;
    border-radius: 24px 24px 0 0;
    padding: 2rem;
    z-index: 1000;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.8), inset 0 2px 20px rgba(255, 255, 255, 0.05);
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calculator-panel.active {
    bottom: 0;
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 1rem;
}

.calc-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

.close-calc-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-calc-btn:hover {
    color: white;
}

.calc-indicator {
    display: flex;
    justify-content: center;
}

.status-badge {
    padding: 0.5rem 2rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.status-badge.win {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.status-badge.fair {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

.status-badge.lose {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

.calc-body {
    display: flex;
    gap: 2rem;
}

.offer-side {
    flex: 1;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.offer-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.offer-side h3 {
    text-align: center;
    margin-bottom: 1.2rem;
    color: #f8fafc;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.offer-list {
    flex-grow: 1;
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

/* Custom Scrollbar for offer lists */
.offer-list::-webkit-scrollbar {
    width: 6px;
}

.offer-list::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 10px;
}

.offer-list::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

.offer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f172a;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid #334155;
    transition: transform 0.2s ease;
}

.offer-item:hover {
    transform: translateX(2px);
    border-color: #475569;
}

.offer-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.offer-item-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.offer-item-details {
    display: flex;
    flex-direction: column;
}

.offer-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.offer-item-variant {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.offer-item-value {
    font-weight: 700;
    color: var(--accent-light);
}

.remove-offer-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-offer-btn:hover {
    background: #ef4444;
    color: white;
}

.offer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.2rem;
    margin-top: 0.5rem;
    border-top: 2px dashed #334155;
    font-size: 1.3rem;
    font-weight: 800;
    color: #e2e8f0;
}

#myTotalValue {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

#theirTotalValue {
    color: #a78bfa;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

@media (max-width: 768px) {
    .calc-body {
        flex-direction: column;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pet-image-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-image-container img {
    max-width: 90px;
    max-height: 90px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}

#modalPetName {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.rarity-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-weight: 600;
}

/* Tabs */
.values-tabs {
    display: flex;
    background: var(--val-bg);
    border-radius: 12px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.val-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.val-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.val-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(139, 92, 246, 0.4));
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
}

/* Main Value item takes full width */
.val-item.main {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
    align-items: center;
}

.val-item.main .val-number {
    font-size: 2.2rem;
    color: #fff;
}

.val-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.val-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f8fafc;
}

/* Loading */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding: 3rem;
}