/* ==========================================
   RESET E BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    width: 100vw;
}


/* ==========================================
   ESTRUTURA PRINCIPAL
   (container, app-container, creator-panel,
   map-container, starMapCanvas, navegação galáxia)
   ========================================== */

/* ===== container ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    display: block;
    width: 100%;
}

@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
        min-height: 80vh;
    }
}

/* ===== app-container ===== */
.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        gap: 20px;
    }
}

.creator-panel,
.map-container,
.app-container {
    transition: all 0.3s ease;
}

/* ===== creator-panel ===== */
.creator-panel {
    flex: 1;
    min-width: 280px;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, opacity 0.3s;
    border: 1px solid;
    height: fit-content;
    overflow-y: auto;
}

.creator-panel.hidden {
    display: none;
}

body.initial-load .creator-panel {
    opacity: 0;
}

/* ===== map-container ===== */
.map-container {
    flex: 2;
    background: transparent;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    height: auto; /* Alterado de 400px para auto */
    display: flex;
    flex-direction: column; /* Adicionado para colocar navegação acima do canvas */
    align-items: center;
    visibility: visible;
    margin: 0 auto;
    width: 100%;
    transition: all 0.3s ease;
    padding-top: 60px; /* Espaço para a navegação fixa */
}

.map-container:not(.full-width) {
    transition: none !important;
    padding-top: 60px; 
}

body.initial-load .map-container {
    transition: none;
}

.map-container.full-width {
    flex: 1;
    width: 100%;
    height: calc(100vh - 60px);
    min-height: 400px;
    max-height: none;
    display: flex;
    flex-direction: column; /* Mantido para consistência */
    justify-content: flex-start; /* Alterado de center para flex-start */
    align-items: center;
    padding-top: 60px; /* Padding consistente */
    margin: 0 auto;
    transition: all 0.3s ease;
    margin-top: 80px;
}

@media (max-width: 1024px) {
    .map-container {
        height: auto; /* Alterado de 450px para auto */
        width: 100%;
        padding-top: 60px; /* Padding consistente */
    }

    .map-container.full-width {
        width: 100%;
        padding-top: 60px; /* Padding consistente */
    }
}

@media (max-width: 768px) {
    .map-container {
        height: auto; /* Alterado de 400px para auto */
        min-height: 400px;
        margin: 0 auto;
        width: 100%;
        padding-top: 60px; /* Padding consistente */
    }

    .map-container.full-width {
        height: calc(100vh - 100px);
        min-height: 350px;
        width: 100%;
        padding-top: 60px; /* Padding consistente */
    }
}

@media (max-width: 480px) {
    .map-container {
        height: auto; /* Alterado de 350px para auto */
        min-height: 350px;
        max-height: none; /* Removido max-height fixo */
        margin: 0 auto;
        width: 100%;
        padding-top: 50px; /* Reduzido ligeiramente para mobile */
    }

    .map-container.full-width {
        height: calc(100vh - 80px);
        min-height: 300px;
        width: 100%;
        padding-top: 50px; /* Reduzido ligeiramente para mobile */
    }
}

@media (max-width: 320px) {
    .map-container {
        height: auto; /* Alterado de 300px para auto */
        min-height: 300px;
        padding-top: 45px; /* Reduzido para mobile pequeno */
    }

    .map-container.full-width {
        height: calc(100vh - 60px);
        min-height: 250px;
        padding-top: 45px; /* Reduzido para mobile pequeno */
    }
}

/* ===== #starMapCanvas ===== */
#starMapCanvas {
    position: relative !important;
    border-radius: 6px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: crosshair;
    margin-top: 0; /* Garante que começa logo após a navegação */
    width: 100%; /* Ocupa toda a largura disponível */
    max-width: 100%; /* Não ultrapassa o container */
}

.map-container.full-width #starMapCanvas {
    cursor: default;
}

.map-container:not(.full-width) #starMapCanvas {
    cursor: crosshair;
}

/* ===== Navegação galáxias ===== */
.galaxy-navigation {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10; /* Garante que fica acima do canvas */
    width: auto;
}

.galaxy-nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Adicionado: Contêiner para o canvas que mantém a proporção */
.canvas-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 0; /* Colado imediatamente após a navegação */
}

/* Ajustes para garantir que não há sobreposição */
.star-info-container,
.star-info-fixed {
    pointer-events: none; /* Permite cliques no canvas */
    z-index: 5; /* Abaixo da navegação mas acima do canvas */
}

.star-info-container > *,
.star-info-fixed > * {
    pointer-events: auto; /* Permite interação com o conteúdo */
}






















/* ==========================================
   CABEÇALHO
   ========================================== */
header {
    text-align: left;
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid;
    position: relative;
    transition: opacity 0.3s ease, margin-bottom 0.3s ease;
}

header.hidden {
    opacity: 0;
    margin-bottom: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
    border-bottom: none;
}

h1 {
    font-size: 2.5rem;
    margin: 30px 0 10px 0;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* ==========================================
   NAVEGAÇÃO DE GALÁXIAS (restante)
   ========================================== */
.galaxy-nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.galaxy-nav-btn {
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.3);
    flex-shrink: 0;
    font-size: 0.7rem;
}

.galaxy-nav-btn:hover {
    transform: scale(1.05);
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.galaxy-nav-btn:active {
    transform: scale(0.95);
}

.galaxy-nav-btn.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
}

.galaxy-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.galaxy-name {
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    text-align: center;
    letter-spacing: 0.3px;
    line-height: 1.1;
    margin-bottom: 5px;
}

/* ==========================================
   INFORMAÇÕES DA ESTRELA
   ========================================== */
.star-info-container,
.star-info-fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.star-info-fixed {
    z-index: 100;
}

.star-info {
    position: absolute;
    padding: 15px 20px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
    border: 1px solid;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.star-info.show {
    opacity: 1;
}

.star-info.fixed {
    pointer-events: auto;
    z-index: 100;
}

.star-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.star-date {
    font-size: 0.8rem;
    opacity: 0.7;
}

.star-message{
    font-size: 1rem;
    margin-top: 5px
}

.close-star-info {
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    color: red;
}

.close-star-info:hover, .copy-link-btn:hover {
    transform: scale(1.1);
    background: none;
    border:none;
}

.copy-link-btn {
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
    color: whitesmoke;
}

.star-actions {
    margin-top: 5px;
    text-align: right;
}

.star-info {
    z-index: 1000;
    pointer-events: auto;
}

/* ==========================================
   NOTIFICAÇÕES
   ========================================== */
.notification {
    display: none;
}

.notification.show {
    display: block;
    position: fixed;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-left: 4px solid;
    border-radius: 5px;
    transition: transform 0.3s;
    z-index: 1000;
}

/* ==========================================
   FORMULÁRIOS E CONTROLES
   ========================================== */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 1rem;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 0.9rem;
}

input, select{
    height: 45px;
}

select{
    max-width: 300px;
}

select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================
   BOTÕES
   ========================================== */
button {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    border: 1px solid;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
}

.btn-criar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.copy-btn {
    font-size: 0.85rem;
    padding: 6px 12px;
}

/* ==========================================
   LAYOUT DE CONTROLES
   ========================================== */
.controls-row {
    display: flex;
    gap: 10px;
}

.controls-row .form-group {
    flex: 1;
    margin-bottom: 15px;
}

.link-result {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    word-break: break-all;
    display: none;
    border: 1px solid;
    font-size: 0.85rem;
}

.link-result a {
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.link-result a:hover {
    text-decoration: underline;
}

/* ==========================================
   INFORMAÇÕES DA GALÁXIA
   ========================================== */
.galaxy-info {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 5px;
    line-height: 1.3;
}

/* ==========================================
   RESPONSIVIDADE EXTRA
   ========================================== */
@media (max-width: 1024px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }
}

/* ==========================================
   ANIMAÇÕES E ACESSIBILIDADE
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid;
    outline-offset: 2px;
}
