/* ==========================================================
   VARIÁVEIS DE CORES E ESTILO
   Facilita a mudança global de cores em um só lugar.
   ========================================================== */
:root {
    --primary: #007bff;
    --primary-hover: #0056b3;
    --dark: #1a1a1a;
    --bg: #f0f2f5;
    --text: #333;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --border: #eeeeee;
}

/* ==========================================================
   RESET E CONFIGURAÇÕES GERAIS
   ========================================================== */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Garante que o rodapé fique no fundo */
}

/* ==========================================================
   HEADER E NAVEGAÇÃO (TOPO)
   ========================================================== */
header {
    background: var(--dark);
    color: var(--white);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky; /* Mantém o menu sempre visível ao rolar */
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i { font-size: 1.6rem; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 15px; /* Espaçamento entre os links */
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover { color: var(--primary); }

.nav-link.active {
    color: var(--white);
    border-bottom: 2px solid var(--primary);
}

/* Badge de Créditos no Topo */
.creditos-badge {
    background: #333;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #444;
    transition: 0.3s;
}

.creditos-badge:hover {
    background: #444;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* ==========================================================
   CONTAINER E CARDS
   ========================================================== */
.container {
    padding: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}


.container-wide {
    width: 100%;
    max-width: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

/* ==========================================================
   BOTÕES E COMPONENTES DE INTERFACE
   ========================================================== */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Menu de Ferramentas (Dashboard) */
.service-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.btn-service {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s ease;
    text-align: center;
}

.btn-service:hover {
    background: var(--white);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ==========================================================
   ESTILOS ESPECÍFICOS DA GALERIA (IMAGENS E VÍDEOS)
   ========================================================== */
.grid-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card-item {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

.card-item:hover { transform: translateY(-5px); }

/* Ajuste para a foto não ser cortada na Galeria */
.img-preview-galeria {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain; /* Mostra a foto inteira sem cortes */
    background: #222; /* Fundo escuro para destacar a arte */
    display: block;
}

/* Estilo para vídeos na galeria */
.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    display: block;
}

/* ==========================================================
   FERRAMENTAS DE IA (FORMULÁRIOS E UPLOADS)
   ========================================================== */
.drop-area {
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 15px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s ease;
    overflow: hidden;
}

.drop-area:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}

/* Preview que aparece dentro do box de upload */
.img-upload-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
}

/* Seleção de Formato (Ratio) */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.ratio-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.3s;
    text-align: center;
}

.ratio-btn.active {
    border-color: var(--primary);
    background: #f0f7ff;
    color: var(--primary);
}

/* ==========================================================
   RESPONSIVIDADE (TABLETS E CELULARES)
   ========================================================== */
@media (max-width: 768px) {
    header { 
        padding: 1rem; 
        flex-direction: column; /* Empilha logo e menu no celular */
        gap: 12px; 
    }
    
    .nav-menu {
        gap: 10px;
        flex-wrap: wrap; /* Permite que os links pulem linha se faltar espaço */
        justify-content: center;
    }

    .container { padding: 5px; }
    
    .upload-row { grid-template-columns: 1fr; } /* Uploads ficam um embaixo do outro */
}

/* Utilitários */
.hidden { display: none !important; }



/* --- IA.PORTALPARALELO - GERADOR FOTOS --- */
.ia-generator-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 20px;
}

.ia-generator-container textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    margin-bottom: 1rem;
    background: var(--bg-card); /* Ajuste conforme sua variável raiz */
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.btn-group-ratio {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.btn-ratio {
    flex: 1;
    padding: 10px;
    background: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
}

.btn-ratio.active {
    background: var(--accent-color); /* Padrão de cor do seu portal */
}

.btn-submit-ia {
    width: 100%;
    padding: 12px;
    background: var(--primary-green); 
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
