/* Estilos para a Oficina de Naves */

.workshop-ship-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: rgba(20, 40, 80, 0.6);
    border: 1px solid rgba(68, 136, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
    min-width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.workshop-ship-selector:hover {
    background: rgba(30, 60, 120, 0.8);
    border-color: #4488ff;
}

.workshop-ship-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(68, 136, 255, 0.5));
}

.workshop-ship-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.workshop-ship-name {
    font-weight: bold;
    color: #fff;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.workshop-ship-type-size {
    font-size: 0.7em;
    color: #88bbff;
    opacity: 0.8;
}

/* Layout da Oficina */
.workshop-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
}

.workshop-attributes-col {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(68,136,255,0.1);
}

.workshop-equipment-col {
    width: 100%;
}

/* Em telas maiores (Desktop e Tablets Landscape), usamos 2 colunas */
@media (min-width: 800px) {
    .workshop-grid {
        grid-template-columns: 0.7fr 1.3fr;
        gap: 25px;
    }
}

/* Ajustes para Mobile Landscape (altura pequena) */
@media (max-height: 500px) and (orientation: landscape) {
    .workshop-grid {
        grid-template-columns: 1fr 1fr; /* Forçar duas colunas mas com larguras iguais ou similares no mobile landscape */
        gap: 15px;
    }
    
    #workshop-slots-container {
        max-height: 180px !important; /* Menor altura para caber na tela deitada */
    }
}

/* Diálogo de Seleção de Nave */
.ship-grid-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
}

.ship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.ship-card {
    background: rgba(20, 30, 50, 0.7);
    border: 1px solid rgba(68, 136, 255, 0.2);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ship-card:hover {
    background: rgba(30, 50, 90, 0.9);
    border-color: #4488ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.ship-card.active {
    border-color: #00ff00;
    background: rgba(0, 50, 0, 0.3);
}

.ship-card.active::after {
    content: 'ATUAL';
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 0.5em;
    color: #0f0;
    font-weight: bold;
}

.ship-card-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.ship-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 100%;
}

.ship-card-name {
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.ship-card-type {
    font-size: 0.65em;
    color: #88bbff;
}

.ship-card-size {
    font-size: 0.6em;
    color: #888;
    text-transform: uppercase;
}

/* Responsividade do Diálogo */
#overlay-workshop-ship-selection,
#overlay-workshop-item-selection,
#overlay-research-menu {
    z-index: 300;
}

#overlay-workshop-ship-selection .dialog-container {
    width: 95vw;
    max-width: 600px;
}

/* Aumentar largura do menu de upgrade para acomodar as duas colunas de slots */
#overlay-upgrade-menu .dialog-container,
#overlay-research-menu .dialog-container {
    width: 95vw;
    max-width: 1100px; /* Aumentado para pesquisa */
}

/* Slots de Equipamento */
.equipment-slot {
    transition: all 0.2s ease;
}

.equipment-slot:hover {
    background: rgba(68, 136, 255, 0.2) !important;
    border-color: #4488ff !important;
    transform: translateX(2px);
    box-shadow: inset 0 0 10px rgba(68, 136, 255, 0.3) !important;
}

.equipment-slot.empty:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #888 !important;
}

.slot-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#workshop-slots-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 400px !important;
    padding-right: 5px;
}

@media (min-width: 600px) {
    #workshop-slots-container {
        grid-template-columns: 1fr; /* Manter 1 coluna dentro do container ja que o pai ja divide em 2 colunas */
    }
}


/* Estilização Customizada dos Sliders */
.attr-row .slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(68, 136, 255, 0.2);
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

.attr-row .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #4488ff;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(68, 136, 255, 0.8);
    transition: transform 0.1s, background 0.2s;
}

.attr-row .slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #4488ff;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(68, 136, 255, 0.8);
}

.attr-row .slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #fff;
}

.attr-row .slider:active::-webkit-slider-thumb {
    transform: scale(0.9);
    background: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

@media (min-width: 900px) {
    #overlay-research-menu .dialog-container {
        width: 90vw;
    }
    #research-items-container > div > div { /* Grid dentro das seções */
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 768px) {
    #overlay-workshop-ship-selection .dialog-container {
        width: 80vw;
    }
}
