:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --card-gradient: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    --text-light: #ffffff;
    --text-muted: #b8c2cc;
    --accent-color: #ffd700;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a0e17 0%, #1a1f2e 50%, #2a2f3e 100%);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="stars" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="0.5" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="0.8" fill="white" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23stars)"/></svg>') repeat;
    opacity: 0.05;
    z-index: -1;
}

.main-content {
    padding-top: 120px;
    padding-bottom: 40px;
    min-height: 100vh;
}

.upgrade-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upgrade-selector {
    background: var(--card-gradient);
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 15px;
    padding: 40px 50px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px auto;
}

.selector-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

.selector-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    justify-items: center;
}

.scroll-items-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
}

.scroll-item-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 90px;
    height: 100px;
    flex: 0 0 90px;
}

.scroll-item-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255,215,0,0.2);
}

.scroll-item-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-item-card img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.scroll-item-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
    line-height: 1.2;
    margin: 0;
    word-wrap: break-word;
    width: 100%;
}

.item-slot {
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.item-slot:hover::before {
    left: 100%;
}

.item-slot:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

.item-slot.selected {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.2);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}

.item-slot img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.item-slot:hover img {
    transform: scale(1.1);
}

.upgrade-results {
    background: var(--card-gradient);
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 15px;
    padding: 40px 50px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    min-height: 400px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.loader-container {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.upgrade-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.upgrade-table th,
.upgrade-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.upgrade-table th {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upgrade-table tr:hover {
    background: rgba(255,255,255,0.05);
}

.rate-high {
    color: var(--success-color);
    font-weight: 600;
}

.rate-medium {
    color: var(--warning-color);
    font-weight: 600;
}

.rate-low {
    color: var(--danger-color);
    font-weight: 600;
}

.item-tooltip {
    position: fixed;
    background: rgba(0,0,0,0.9);
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 15px;
    z-index: 9999;
    display: none;
    max-width: 300px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.tooltip-title {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.tooltip-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: none !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 100px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header {
        padding: 20px;
    }

    .upgrade-content {
        gap: 15px;
    }

    .upgrade-selector,
    .upgrade-results {
        padding: 20px 15px;
        margin: 0 10px 15px 10px;
        max-width: none;
    }

    .scroll-items-grid {
        gap: 8px;
        padding: 5px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .scroll-item-card {
        padding: 6px;
        width: 65px;
        height: 85px;
        flex: 0 0 65px;
    }

    .scroll-item-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 4px;
    }

    .scroll-item-icon img {
        width: 28px;
        height: 28px;
    }

    .scroll-item-name {
        font-size: 0.6rem;
        line-height: 1.1;
    }

    .item-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }

    .item-slot {
        width: 60px;
        height: 60px;
    }

    .item-slot img {
        width: 48px;
        height: 48px;
    }
}