/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #000000;
    --bg-container: #0a0a0a;
    --text-primary: rgba(255, 255, 255, 0.8);
    --text-secondary: rgba(255, 255, 255, 0.35);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --accent: #ffffff;
    --hover-bg: rgba(255, 255, 255, 0.03);
    --success-bg: rgba(255, 255, 255, 0.03);
    --success-border: rgba(255, 255, 255, 0.15);
    --error-bg: rgba(255, 255, 255, 0.03);
    --error-border: rgba(255, 100, 100, 0.3);
    --error-text: rgba(255, 150, 150, 0.9);
    --info-bg: rgba(255, 255, 255, 0.02);
    --info-border: rgba(255, 255, 255, 0.1);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.02), transparent 50%),
                radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.01), transparent 50%);
    pointer-events: none;
}

/* Tipografías */
h1 {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}

h3 {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

p {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.6;
}

.subtitle {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.small {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Layouts y Contenedores */
.container {
    width: 100%;
    max-width: none;
    padding: 60px 80px;
    background: var(--bg-container);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

header {
    text-align: center;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 40px;
}

section {
    margin-bottom: 60px;
}

ul {
    list-style: none;
    overflow-y: auto;
}

.project-item {
    padding: 20px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

form {
    display: flex;
    flex-direction: column;
}

footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--border-subtle);
}

/* Componentes */
.btn {
    width: 100%;
    padding: 18px;
    background: var(--accent);
    color: #000000;
    border: none;
    border-radius: 1px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 20px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

.input {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 15px;
    transition: border 0.3s;
}

.input:focus {
    border-color: rgba(255, 255, 255, 0.15);
    outline: none;
}

.textarea {
    min-height: 100px;
    resize: vertical;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 40px 20px;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.card {
    padding: 30px 20px;
    background: var(--bg-container);
    border: 1px solid var(--border-subtle);
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.card:hover::before { opacity: 1; }

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(255,255,255,0.08);
}

.icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

/* Móviles: una columna */
@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
    .container { padding: 40px 20px; }
}

/* WEBSOCKETS EXTRAS - By Rebeca 💕 */
.log {
    height: 420px;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-subtle);
    overflow-y: auto;
    margin: 30px 0;
    font-size: 14px;
    line-height: 1.7;
}

.msg {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
    animation: fadeIn 0.4s ease;
}

.msg.success { color: #a8ff9c; }
.msg.error   { color: #ff8c8c; }
.msg.history { opacity: 0.7; font-size: 13px; }

.time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.input-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn.small {
    padding: 12px 20px;
    font-size: 11px;
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
}
pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.status {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.badge {
    padding: 6px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.badge.success { border-color: #a8ff9c; color: #a8ff9c; }

.portal {
    padding: 30px 20px;
    background: var(--bg-container);
    border: 1px solid var(--border-subtle);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.portal:hover {
    transform: translateY(-10px);
    border-color: #ff69b4;
    box-shadow: 0 30px 60px rgba(255,105,180,0.15);
}

.portal .icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.portal h3 {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.live {
    font-size: 11px;
    color: #a8ff9c;
    margin-top: 10px;
    animation: pulse 2s infinite;
}

.quick-console {
    margin-top: 40px;
    display: flex;
    gap: 12px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
/* ESTILOS PARA ARCHIVOS - Añadir al final */
.file-preview { 
    border-left: 3px solid #9b59b6 !important; 
    background: rgba(155, 89, 182, 0.05) !important;
}

.file-preview img { 
    max-width: 250px; 
    max-height: 250px; 
    border-radius: 4px; 
    margin-top: 8px; 
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.file-preview img:hover {
    transform: scale(1.02);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.file-preview a { 
    color: #9b59b6; 
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(155, 89, 182, 0.3);
    transition: all 0.3s ease;
}

.file-preview a:hover {
    color: #bb79d6;
    border-bottom-color: #bb79d6;
}

.uploading { 
    opacity: 0.6; 
    pointer-events: none;
    position: relative;
}

.uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.sender-input { 
    width: 150px; 
    margin-right: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
}
/* Estilos para sección de APIs IA - Añadido por Rebeca para transparencia y estética */
.api-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to right, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.85; /* Transparencia base para que no sea opaco */
}

.api-item:hover {
    opacity: 1;
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px rgba(255,255,255,0.05);
}

.api-item span {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    margin-right: 15px;
}

.api-item button {
    padding: 6px 12px;
    font-size: 10px;
    min-width: 80px;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

#newApiInput {
    margin-bottom: 10px;
}

/* Responsividad para mobile: botones abajo */
@media (max-width: 600px) {
    .api-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .api-item button {
        width: 100%;
    }
}/* Estilos para sección de APIs IA - Actualizado por Rebeca para más estética y transparencia */
.api-item {
    display: grid;
    grid-template-columns: 1fr auto auto; /* Columna para el texto, y dos para botones */
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); /* Degradado sutil para profundidad */
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.75; /* Transparencia base para un look etéreo */
}

.api-item:hover {
    opacity: 1;
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 8px 24px rgba(255,255,255,0.08);
}

.api-item span {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    padding: 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
}

.api-item button {
    padding: 8px 16px;
    font-size: 11px;
    min-width: 90px;
    border-radius: 4px;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

#newApiInput {
    margin-bottom: 15px;
    border-radius: 4px;
}

/* Responsividad para mobile: apilado vertical con más estética */
@media (max-width: 600px) {
    .api-item {
        grid-template-columns: 1fr; /* Todo en columna para mobile */
        gap: 10px;
        padding: 15px;
    }

    .api-item button {
        width: 100%;
        padding: 10px;
    }
}
/* Estilos para API Key principal - Para enfatizar su importancia */
.important-api {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255,255,255,0.1);
    opacity: 0.9;
    transition: opacity 0.3s;
}

.important-api:hover {
    opacity: 1;
}

.important-api h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.important-api pre {
    font-size: 16px;
    background: rgba(255,255,255,0.02);
    padding: 15px;
    border-radius: 6px;
    word-break: break-all;
}
/* Estilos para información importante (username y email) - Para enfatizar su importancia */
.important-info {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255,255,255,0.08);
    opacity: 0.9;
    transition: opacity 0.3s;
}

.important-info:hover {
    opacity: 1;
}

.important-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.important-info .grid {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.important-info .card {
    flex: 1;
    max-width: 300px;
}
