:root {
    --primary-green: rgb(162, 255, 31);
    --dark-gray: rgb(30, 30, 30);
    --accent-pink: #f465c5;
    --accent-green: #44d84f;
    --accent-yellow: #fff788;
    --accent-blue: #6694e8;
}

/* Reset e Estilos Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: black;
    color: white;
    display: flex;
    min-height: 100vh;
}

/* Conteúdo Principal */
main {
    padding: 2rem;
    width: 100%;
}

/* Logo */
.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.logo img {
    width: 360px;
}

/* Busca e Filtros */
.search-container {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background-color: var(--dark-gray);
    color: white;
    font-size: 1rem;
}

.search-input:focus {
    outline: 2px solid var(--primary-green);
}

.filter-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Botões de Filtro */
.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border: none;
    background-color: var(--dark-gray);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.filter-btn img {
    width: auto;
    height: 24px;
    max-width: 24px;
    object-fit: contain;
}

.filter-btn span {
    font-weight: 500;
}

.filter-btn:hover {
    background-color: rgba(162, 255, 31, 0.1);
}

.filter-btn.active {
    background-color: var(--primary-green);
    color: black;
}

/* Botão Create Beyblade */
.create-beyblade-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-green);
    background-color: transparent;
    color: var(--primary-green);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: bold;
}

.create-beyblade-btn:hover {
    background-color: var(--primary-green);
    color: black;
}

.create-icon {
    width: 20px;
    height: 20px;
}

/* Grid de Beyblades */
.beyblade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards de Beyblade */
.beyblade-card {
    background-color: var(--dark-gray);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
    padding: 1.5rem;
}

.beyblade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        to right,
        var(--accent-pink),
        var(--accent-blue),
        var(--accent-green),
        var(--accent-yellow)
    );
}

.beyblade-card:hover {
    transform: translateY(-5px);
}

/* Badge de Tipo */
.type-badge {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.type-badge img {
    width: auto;
    height: 24px;
    max-width: 24px;
    object-fit: contain;
}

/* Informações do Card */
.beyblade-card-info h3 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Grid de Partes */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.part-item {
    text-align: center;
    cursor: pointer;
}

.part-img {
    width: 100%;
    height: 60px;
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.part-item:hover .part-img {
    transform: scale(1.1);
}

.part-name {
    font-size: 0.8rem;
    color: #ccc;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estatísticas */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #ccc;
}

.stat-bar {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-green), var(--accent-green));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stat-value {
    font-size: 0.8rem;
    color: var(--primary-green);
    text-align: right;
}

/* Modal Base */
.part-modal,
.builder-modal,
.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background-color: #0f0f0f;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    z-index: 1001;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 12px 12px 0 0;
}

/* Botão Fechar Modal */
.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Estilos do Builder */
.builder-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-buttons {
    display: flex;
    gap: 1rem;
}

.step-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background-color: var(--dark-gray);
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.step-btn.active {
    background-color: var(--primary-green);
    color: black;
}

.parts-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Opções de Peças */
.part-option {
    background-color: var(--dark-gray);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.part-option:hover {
    transform: translateY(-2px);
    background-color: rgba(162, 255, 31, 0.1);
}

.part-option.selected {
    border: 2px solid var(--primary-green);
}

.part-option img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

/* Preview do Builder */
.builder-preview {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.builder-preview h3 {
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.selected-parts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.selected-part {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    min-height: 120px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.selected-part img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

/* Botão de Comparação */
.compare-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-green);
    border: none;
    border-radius: 8px;
    color: black;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.compare-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal de Comparação */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
}

.vs-badge {
    background-color: var(--accent-pink);
    color: white;
    padding: 1rem;
    border-radius: 50%;
    font-weight: bold;
    margin-top: 2rem;
}

.opponents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-bottom: 100px;
}

/* Detalhes da Peça */
.part-details {
    text-align: center;
}

.part-details .part-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin: 1rem 0;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.part-details h3 {
    color: var(--primary-green);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.part-details .type-badge {
    position: static;
    display: inline-flex;
    margin: 1rem 0;
}

.part-details .type-icon {
    width: auto;
    height: 24px;
    max-width: 24px;
}

/* Responsividade */
@media (max-width: 992px) {
    .beyblade-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .vs-badge {
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    .step-buttons {
        flex-direction: column;
    }

    .selected-parts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        width: 100%;
    }

    .modal-content {
        padding: 1rem;
    }

    .parts-selection {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Detalhes da Peça */
.part-details-container {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
    gap: 2rem;
    height: 100%;
}

.part-details {
    text-align: center;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.part-details.selected-part {
    background-color: rgba(162, 255, 31, 0.05);
    border: 1px solid var(--primary-green);
}

.part-details .part-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin: 1rem 0;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.part-details h3 {
    color: var(--primary-green);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.part-details .type-badge {
    position: static;
    display: inline-flex;
    margin: 1rem 0;
}

.part-details .type-icon {
    width: auto;
    height: 24px;
    max-width: 24px;
}

.parts-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.parts-comparison h4 {
    color: var(--primary-green);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.comparison-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: 70vh;
    padding-right: 1rem;
}

.comparison-list::-webkit-scrollbar {
    width: 8px;
}

.comparison-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.comparison-list::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

.part-details.comparison-part {
    transition: transform 0.3s ease;
}

.part-details.comparison-part:hover {
    transform: translateX(-5px);
}

/* Responsividade para o modal de detalhes */
@media (max-width: 992px) {
    .part-details-container {
        grid-template-columns: 1fr;
    }
    
    .comparison-list {
        max-height: 50vh;
    }
    
    .part-details .part-image {
        width: 150px;
        height: 150px;
    }
}