/* --- RESET Y VARIABLES --- */
:root {
    /* Paleta Minimalista Clara */
    --bg-main: #f4f7f6;
    /* Gris azulado muy tenue */
    --bg-card: #ffffff;
    /* Blanco puro */
    --text-main: #1a1a1a;
    /* Casi negro para texto */
    --text-muted: #64748b;
    /* Gris para subtítulos */
    --border-color: #e2e8f0;
    /* Gris muy claro para bordes */

    /* Colores de Acento Profesional */
    --primary: #0047AB;
    /* Cobalt Blue - Profesional y serio */
    --primary-hover: #003580;
    --secondary: #f1f5f9;
    /* Gris claro para botones secundarios */
    --secondary-hover: #e2e8f0;

    /* Estados */
    --success: #10b981;
    --warning: #f59e0b;

    /* Sombras y Bordes */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --radius-md: 8px;
    --radius-sm: 4px;

    /* Tipografía */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT GENERAL --- */
.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    padding-bottom: 5rem;
    /* Espacio para footer */
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- HEADER --- */
.main-header {
    background-color: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
}

.logo-area .accent {
    color: var(--primary);
}

.version-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#save-status {
    font-size: 0.85rem;
    font-weight: 500;
}

.status-neutral {
    color: var(--text-muted);
}

.status-success {
    color: var(--success);
}

/* --- NAVEGACIÓN (TABS) --- */
.main-nav {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0;
}

.tab-link {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-link:hover {
    color: var(--primary);
    background-color: var(--secondary);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* --- COMPONENTES UI (TARJETAS, FORMS) --- */
.card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
}

.section-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-stack);
    font-size: 0.95rem;
    background-color: #fff;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* --- BOTONES --- */
button {
    font-family: var(--font-stack);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-wide {
    width: 100%;
}

/* --- CONTENIDO TABS --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* --- ESPECÍFICOS DE MÓDULOS --- */

/* Items List (Scenarios, Wardrobe) */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.list-item {
    background-color: var(--secondary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Content Engine Outputs */
.copy-container {
    position: relative;
    margin-bottom: 1rem;
}

.copy-container textarea {
    min-height: 150px;
    padding-right: 3rem;
    background-color: #f8fafc;
    border-style: dashed;
}

.btn-copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.btn-copy:hover {
    color: var(--primary);
    background-color: #fff;
}

.instruction-box {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border-left: 4px solid var(--border-color);
}

.instruction-box h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.instruction-box.important {
    background-color: rgba(245, 158, 11, 0.05);
    border-left-color: var(--warning);
    color: #92400e;
}

/* Asset Manager Grid */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.asset-slot {
    border: 2px dashed var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.asset-slot.empty {
    color: var(--text-muted);
    background-color: #f8fafc;
}

.slot-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #000;
}

.slot-status {
    font-size: 0.8rem;
}

/* --- FOOTER --- */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- ICONOGRAFÍA (Lucide SVG) --- */
.icon-sm {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

/* Alineación de íconos en botones y encabezados */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slot-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.copy-container .btn-copy {
    padding: 0.4rem;
}

.copy-container .btn-copy .icon-sm {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* --- ESTILOS DE IDEACIÓN --- */
.highlight-card {
    background-color: #f8fafc;
    /* Azul/Gris ultra claro */
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.highlight-card h3 {
    color: var(--primary);
}

/* --- GALERÍA DE AVATARES --- */
.avatar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.avatar-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
}

.avatar-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.15);
    transform: translateY(-2px);
}

.avatar-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.2);
}

.avatar-card.active::after {
    content: '✓ Activo';
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 2;
}

.avatar-card-img {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-card-placeholder {
    color: var(--text-muted);
    font-size: 2rem;
    opacity: 0.4;
}

.avatar-card-info {
    padding: 0.6rem 0.75rem;
}

.avatar-card-info strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-card-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.avatar-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.avatar-card:hover .avatar-card-delete {
    opacity: 1;
}

.avatar-card-delete:hover {
    background: #dc2626;
}

.avatar-card-new {
    border-style: dashed;
    border-color: var(--text-muted);
    opacity: 0.6;
}

.avatar-card-new:hover {
    opacity: 1;
    border-color: var(--primary);
}

.avatar-card-new .avatar-card-placeholder {
    font-size: 1.5rem;
}

/* Estado warning */
.status-warning {
    color: var(--warning);
}