/* Variables de colores */
* {
    text-decoration: none;
    box-sizing: border-box;
}

:root {
    /* Paleta DARK basada en #232323 */
    --base: #232323;        /* Fondo principal */
    --base-light: #2e2e2e;  /* Secciones, hover */
    --base-lighter: #3a3a3a;/* Bordes, navbar */
    --text-light: #f5f5f5;  /* Texto claro */
    --accent: #4a4a4a;      /* Botones, elementos destacados */

    --primary: var(--accent);
    --secondary: var(--base-lighter);

    /* Variables para botones */
    --button-height: 2.2rem;
    --button-padding-x: 0.8rem;
    --button-font-size: 0.9rem;
}
.img-small{
    width: 80% !important;
    height: auto;
}
/* Modo LIGHT: sobrescribe variables usando gama gris */
body.light {
    --base: #e5e5e5;        /* Fondo principal claro */
    --base-light: #f0f0f0;  /* Secciones */
    --base-lighter: #d4d4d4;/* Bordes, navbar */
    --text-light: #232323;  /* Texto oscuro */
    --accent: #b0b0b0;      /* Botones grises */

    --primary: #3a3a3a;     /* Botones oscuros */
    --secondary: #f7f7f7;   /* Tarjetas con fondo muy claro */
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    transition: background 0.3s, color 0.3s;
    color: var(--text-light);
    background: var(--base);
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    transition: background 0.3s, color 0.3s;
    background: var(--base-lighter);
    color: var(--text-light);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo img {
    height: 50px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.nav-links a {
    color: inherit;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.7;
}

/* Botones */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#theme-toggle,
.search-btn,
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--button-height);
    padding: 0 var(--button-padding-x);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    font-size: var(--button-font-size);
}

#theme-toggle {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    width: var(--button-height);
    padding: 0;
    margin: 1rem;
}

#theme-toggle .icon-moon,
#theme-toggle .icon-sun {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.icon-moon, .icon-sun {
    display: none;
}

body.dark .icon-moon {
    display: inline;
}

body.light .icon-sun {
    display: inline;
}

/* Search */
.search-container {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

input[type="text"] {
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: inherit;
    color: inherit;
    transition: border 0.3s;
    height: var(--button-height);
}

.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
}

.search-btn:hover {
    background: var(--base-lighter);
    color: #fff;
}

/* Secciones principales */

main {
    flex: 1; /* Ocupa todo el espacio disponible, empuja el footer abajo */
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 1rem;
    justify-content: flex-start;
}

section {
    flex: 1;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    border: 2px solid var(--accent);
    border-radius: 15px;
    transition: border-color 0.3s, background 0.3s, color 0.3s;
    background: var(--base-light);
    color: inherit;
}

section h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: inherit;
    text-align: center;
}

/* Tarjetas */
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content:space-evenly;
    align-items: center;
    background: var(--secondary);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.25s ease, background 0.25s ease;
    width: 120px;
    height: 150px;
    cursor: pointer;
    color: var(--text-light);
}

.card img {
    width: 60%;
    height: auto;
    transition: transform 0.25s ease-in-out;
}

.card span {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: inherit;
}

.card:hover img {
    transform: scale(1.2) rotate(5deg);
}

.card:hover {
    transform: translateY(-5px) scale(1.05);
    background: var(--accent);
}
/* --- Footer responsivo --- */
footer {
    background: var(--base-lighter);
    color: var(--text-light);
    padding: 12px 0;
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-top: 1px solid var(--accent);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-right: 1rem;
}

.social-icons a {
    color: inherit;
    font-size: 1.3rem;
    transition: color 0.2s ease-in-out;
}

.social-icons a:hover {
    color: #0070d1;
}

.powered {
    font-size: 0.8rem;
    opacity: 0.8;
}


/* Responsive */
@media (max-width: 1024px) {
    *{
      word-wrap: break-word;
    }
    .nav-left {
        gap: 1.5rem;
    }
    .nav-links {
        gap: 1rem;
    }
    main {
        flex-direction: column;
        align-items: center;
    }
    section {
        width: 100%;
        min-height: auto;
        margin-bottom: 1rem;
    }
    .card {
        width: 120px;
        padding: 0.8rem;
    }
}

@media (max-width: 767px) {
    .navbar {
        flex-wrap: wrap;
    }
    .nav-left {
        gap: 1rem;
    }
    .nav-links {
        display: none;
    }
    .search-container {
        width: 100%;
        margin-top: 0.5rem;
    }
    .navbar.open .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        text-align: center;
        margin-top: 1rem;
    }
    footer {
        font-size: 0.8rem;
        padding: 10px 20px;
    }
    .social-icons a {
        font-size: 1.1rem;
    }
}
