/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-color: #050505;
    --surface-color: #111111;
    --surface-light: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-color: #ffffff;
    --accent-hover: #e5e5e5;
    --border-color: #27272a;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Cursor personalizado si quieres */
    /* cursor: url('../js/assets/cursor-def.png'), auto; */
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
header {
    background-color: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeInUp 0.8s ease-out;
}

/* Logo con Imagen */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 45px; /* Ajusta según el tamaño de tu logo */
    width: auto;
    object-fit: contain;
    /* ELIMINAMOS EL FILTRO QUE LO VOLVÍA BLANCO */
    /* filter: brightness(0) invert(1); */ 
}

.logo-text {
    font-family: var(--font-main);
    font-size: 1.6rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 100px 20px;
    text-align: center;
    background-image: url('../js/assets/background.avif'); /* Ruta a tu imagen de fondo */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border-color);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85); /* Oscurece el fondo para que el texto se lea */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

/* Grid de Herramientas */
.tool-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden; /* Para que la imagen respete el borde redondeado */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: #555;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.tool-image {
    width: 100%;
    height: 180px; /* Altura fija para uniformidad */
    object-fit: cover; /* Recorta la imagen sin deformarla */
    border-bottom: 1px solid var(--border-color);
    background-color: #000;
}

.tool-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tool-info h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.tool-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

.tool-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 10px;
    display: block;
}

/* Resto de estilos (buscador, botones, footer) se mantienen igual */
.search-container { width: 100%; max-width: 600px; position: relative; }
.search-container input {
    width: 100%; padding: 14px 24px; border-radius: 50px;
    border: 1px solid var(--border-color); background-color: var(--surface-color);
    color: var(--text-primary); font-family: var(--font-main); font-size: 0.95rem;
    outline: none; transition: all 0.4s ease;
}
.search-container input:focus { border-color: #555; background-color: #1a1a1a; box-shadow: 0 0 0 4px rgba(255,255,255,0.05); }
nav ul { display: flex; list-style: none; gap: 25px; flex-wrap: wrap; justify-content: center; }
nav a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.9rem; transition: color 0.3s; }
nav a:hover { color: var(--text-primary); }
.container { max-width: 1200px; margin: 60px auto; padding: 0 24px; animation: fadeInUp 1s ease-out; }
h1, h2, h3, h4 { color: var(--text-primary); font-weight: 700; letter-spacing: -0.03em; }
h1 { font-size: 3rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 1.05rem; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; }
.btn { display: inline-block; background-color: var(--accent-color); color: #000; padding: 14px 28px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.95rem; text-align: center; transition: all 0.3s ease; border: 1px solid transparent; margin-top: 20px; cursor: pointer; }
.btn:hover { background-color: var(--accent-hover); transform: translateY(-2px); }
.btn-outline { background-color: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline:hover { border-color: var(--text-primary); background-color: rgba(255,255,255,0.05); }
#search-results { position: absolute; top: calc(100% + 10px); left: 0; width: 100%; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; max-height: 350px; overflow-y: auto; display: none; z-index: 1001; box-shadow: 0 20px 50px rgba(0,0,0,0.8); animation: fadeInUp 0.3s ease-out; }
#search-results div { padding: 15px 25px; cursor: pointer; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; }
#search-results div:last-child { border-bottom: none; }
#search-results div:hover { background-color: var(--surface-light); padding-left: 35px; }
footer { border-top: 1px solid var(--border-color); padding: 40px 20px; text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-top: 80px; }


/* ============================================ */
/* USUARIO EN EL HEADER                          */
/* ============================================ */

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    gap: 20px;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.user-button:hover {
    background-color: var(--surface-light);
    border-color: #555;
    transform: translateY(-2px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #222;
    border: 1px solid var(--border-color);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.user-avatar-guest {
    background: linear-gradient(135deg, #333, #555);
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================ */
/* MODAL DE LOGIN/REGISTRO                       */
/* ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.4s ease;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: var(--surface-light);
    color: var(--text-primary);
}

.modal h2 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.modal-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    padding: 14px 18px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.form-error {
    color: #ff5555;
    font-size: 0.85rem;
    text-align: center;
    min-height: 20px;
}

.form-success {
    color: #22c55e;
    font-size: 0.85rem;
    text-align: center;
    min-height: 20px;
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

/* ============================================ */
/* MENÚ DROPDOWN DEL USUARIO                     */
/* ============================================ */

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 220px;
    padding: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    animation: slideUp 0.2s ease;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.user-dropdown-header strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.user-dropdown-header span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-dropdown-header .plan-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    background-color: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background-color: var(--surface-light);
    color: var(--text-primary);
}

.user-dropdown .logout-btn {
    color: #ff5555;
}

.user-dropdown .logout-btn:hover {
    background-color: rgba(255, 85, 85, 0.1);
    color: #ff5555;
}

.user-wrapper {
    position: relative;
}