/* ========================================
   FUENTES
   ======================================== */
@font-face {
    font-family: 'Regular';
    src: url(../../recursos/fonts/Regular.woff2), url(../../recursos/fonts/Regular.woff);
}

@font-face {
    font-family: 'Negrita';
    src: url(../../recursos/fonts/Negrita.woff2), url(../../recursos/fonts/Negrita.woff);
}

/* ========================================
   RESET GLOBAL
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Flexbox en Body para centrado perfecto */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centra horizontalmente el contenedor */
    justify-content: start;
    /* Pega el contenido arriba, evita cortes */
    min-height: 100vh;
    width: 100%;
    background-color: #ffffff;
}

/* Animación global */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ========================================
   1. LARGE SCREENS (> 1367px)
   ======================================== */
@media (min-width: 1367px) {
    body {
        font-family: 'Regular', Calibri, sans-serif;
        color: #213242;
        /* Padding solo para separar del borde superior, NO para layout */
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .container {
        width: 1300px;
        /* Ancho fijo seguro */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 40px;
        /* Espaciado entre bloques (header, search, cats, grid) */
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    h1 {
        font-family: 'Negrita', Calibri, sans-serif;
        font-size: 3rem;
        color: #213242;
        text-align: center;
    }

    header p {
        font-size: 1.1rem;
        color: #213242;
    }

    .search-container {
        position: relative;
        width: 700px;
    }

    #search-input {
        width: 100%;
        height: 60px;
        padding-left: 25px;
        padding-right: 60px;
        border: 2px solid #e1b783;
        border-radius: 35px;
        font-size: 18px;
        font-family: 'Regular', Calibri, sans-serif;
        background-color: #ffffff;
        color: #213242;
        outline: none;
    }

    .search-icon {
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .categories {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
        width: 100%;
    }

    .category-btn {
        height: 45px;
        padding-left: 24px;
        padding-right: 24px;
        border: 2px solid #e1b783;
        border-radius: 30px;
        background-color: transparent;
        font-family: 'Regular', Calibri, sans-serif;
        font-size: 16px;
        color: #213242;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #213242;
        color: #ffffff;
    }

    .emoji-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        /* 5 Columnas */
        gap: 25px;
        width: 100%;
    }

    .emoji-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 25px;
        background-color: #ffffff;
        border: 2px solid #e1b783;
        border-radius: 20px;
        box-shadow: 0 4px 10px rgba(225, 183, 131, 0.3);
        cursor: pointer;
        gap: 15px;
        transition: transform 0.3s;
        /* Tablet & Mobile Optimization */
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .emoji-item:hover {
        transform: translateY(-5px);
    }

    .emoji {
        font-size: 3.5rem;
    }

    .emoji-name {
        font-size: 1rem;
        color: #213242;
        text-align: center;
    }

    footer {
        display: flex;
        justify-content: center;
        padding-top: 20px;
        font-size: 1.1rem;
        color: #213242;
    }

    .notification {
        position: fixed;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background-color: #e1b783;
        color: #213242;
        padding: 15px 30px;
        border-radius: 40px;
        opacity: 0;
        transition: all 0.5s;
        z-index: 1000;
        display: flex;
        align-items: center;
        gap: 15px;
        font-size: 1.2rem;
    }

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   2. DESKTOP (1281px - 1366px)
   ======================================== */
@media (min-width: 1281px) and (max-width: 1366px) {
    body {
        font-family: 'Regular', Calibri, sans-serif;
        color: #213242;
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .container {
        width: 1100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    h1 {
        font-family: 'Negrita', Calibri, sans-serif;
        font-size: 2.8rem;
        color: #213242;
        text-align: center;
    }

    header p {
        font-size: 1rem;
        color: #213242;
    }

    .search-container {
        position: relative;
        width: 600px;
    }

    #search-input {
        width: 100%;
        height: 55px;
        padding-left: 20px;
        padding-right: 55px;
        border: 2px solid #e1b783;
        border-radius: 30px;
        font-size: 17px;
        font-family: 'Regular', Calibri, sans-serif;
        background-color: #ffffff;
        color: #213242;
        outline: none;
    }

    .search-icon {
        position: absolute;
        top: 0;
        right: 0;
        width: 55px;
        height: 55px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .categories {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .category-btn {
        height: 40px;
        padding-left: 20px;
        padding-right: 20px;
        border: 2px solid #e1b783;
        border-radius: 25px;
        background-color: transparent;
        font-family: 'Regular', Calibri, sans-serif;
        font-size: 15px;
        color: #213242;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #213242;
        color: #ffffff;
    }

    .emoji-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        /* 4 Columnas */
        gap: 20px;
        width: 100%;
    }

    .emoji-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background-color: #ffffff;
        border: 2px solid #e1b783;
        border-radius: 15px;
        box-shadow: 0 4px 10px rgba(225, 183, 131, 0.3);
        cursor: pointer;
        gap: 10px;
        transition: transform 0.3s;
    }

    .emoji-item:hover {
        transform: translateY(-5px);
    }

    .emoji {
        font-size: 3rem;
    }

    .emoji-name {
        font-size: 0.9rem;
        color: #213242;
        text-align: center;
    }

    footer {
        display: flex;
        justify-content: center;
        padding-top: 15px;
        font-size: 1rem;
        color: #213242;
    }

    .notification {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background-color: #e1b783;
        color: #213242;
        padding: 12px 25px;
        border-radius: 40px;
        opacity: 0;
        transition: all 0.5s;
        z-index: 1000;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 1.1rem;
    }

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   3. LAPTOP (1025px - 1280px)
   ======================================== */
@media (min-width: 1025px) and (max-width: 1280px) {
    body {
        font-family: 'Regular', Calibri, sans-serif;
        color: #213242;
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .container {
        width: 900px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    h1 {
        font-family: 'Negrita', Calibri, sans-serif;
        font-size: 2.5rem;
        color: #213242;
        text-align: center;
    }

    header p {
        font-size: 1rem;
        color: #213242;
    }

    .search-container {
        position: relative;
        width: 500px;
    }

    #search-input {
        width: 100%;
        height: 50px;
        padding-left: 20px;
        padding-right: 50px;
        border: 2px solid #e1b783;
        border-radius: 28px;
        font-size: 16px;
        font-family: 'Regular', Calibri, sans-serif;
        background-color: #ffffff;
        color: #213242;
        outline: none;
    }

    .search-icon {
        position: absolute;
        top: 0;
        right: 0;
        width: 50px;
        height: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .categories {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .category-btn {
        height: 36px;
        padding-left: 18px;
        padding-right: 18px;
        border: 2px solid #e1b783;
        border-radius: 25px;
        background-color: transparent;
        font-family: 'Regular', Calibri, sans-serif;
        font-size: 14px;
        color: #213242;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #213242;
        color: #ffffff;
    }

    .emoji-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        /* 3 Columnas */
        gap: 18px;
        width: 100%;
    }

    .emoji-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 18px;
        background-color: #ffffff;
        border: 2px solid #e1b783;
        border-radius: 15px;
        box-shadow: 0 4px 10px rgba(225, 183, 131, 0.3);
        cursor: pointer;
        gap: 8px;
        transition: transform 0.3s;
    }

    .emoji-item:hover {
        transform: translateY(-5px);
    }

    .emoji {
        font-size: 2.5rem;
    }

    .emoji-name {
        font-size: 0.85rem;
        color: #213242;
        text-align: center;
    }

    footer {
        display: flex;
        justify-content: center;
        padding-top: 15px;
        font-size: 0.95rem;
        color: #213242;
    }

    .notification {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background-color: #e1b783;
        color: #213242;
        padding: 12px 25px;
        border-radius: 40px;
        opacity: 0;
        transition: all 0.5s;
        z-index: 1000;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1rem;
    }

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   4. TABLET (768px - 1024px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        font-family: 'Regular', Calibri, sans-serif;
        color: #213242;
        padding-top: 25px;
        padding-bottom: 25px;
    }

    .container {
        width: 680px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    h1 {
        font-family: 'Negrita', Calibri, sans-serif;
        font-size: 2.2rem;
        color: #213242;
        text-align: center;
    }

    header p {
        font-size: 1rem;
        color: #213242;
    }

    .search-container {
        position: relative;
        width: 450px;
    }

    #search-input {
        width: 100%;
        height: 45px;
        padding-left: 18px;
        padding-right: 45px;
        border: 2px solid #e1b783;
        border-radius: 25px;
        font-size: 16px;
        font-family: 'Regular', Calibri, sans-serif;
        background-color: #ffffff;
        color: #213242;
        outline: none;
    }

    .search-icon {
        position: absolute;
        top: 0;
        right: 0;
        width: 45px;
        height: 45px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .categories {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .category-btn {
        height: 32px;
        padding-left: 16px;
        padding-right: 16px;
        border: 2px solid #e1b783;
        border-radius: 20px;
        background-color: transparent;
        font-family: 'Regular', Calibri, sans-serif;
        font-size: 14px;
        color: #213242;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #213242;
        color: #ffffff;
    }

    .emoji-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 Columnas */
        gap: 15px;
        width: 100%;
    }

    .emoji-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 15px;
        background-color: #ffffff;
        border: 2px solid #e1b783;
        border-radius: 15px;
        box-shadow: 0 4px 10px rgba(225, 183, 131, 0.3);
        cursor: pointer;
        gap: 5px;
    }

    .emoji {
        font-size: 2.2rem;
    }

    .emoji-name {
        font-size: 0.8rem;
        color: #213242;
        text-align: center;
    }

    footer {
        display: flex;
        justify-content: center;
        padding-top: 15px;
        font-size: 0.9rem;
        color: #213242;
    }

    .notification {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background-color: #e1b783;
        color: #213242;
        padding: 12px 25px;
        border-radius: 40px;
        opacity: 0;
        transition: all 0.5s;
        z-index: 1000;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1rem;
    }

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   5. MOBILE (481px - 767px)
   ======================================== */
@media (min-width: 481px) and (max-width: 767px) {
    body {
        font-family: 'Regular', Calibri, sans-serif;
        color: #213242;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .container {
        width: 420px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 0 10px;
    }

    h1 {
        font-family: 'Negrita', Calibri, sans-serif;
        font-size: 1.8rem;
        color: #213242;
        text-align: center;
        line-height: 1.3;
    }

    header p {
        font-size: 0.9rem;
        color: #213242;
        text-align: center;
    }

    .search-container {
        position: relative;
        width: 100%;
    }

    #search-input {
        width: 100%;
        height: 42px;
        padding-left: 15px;
        padding-right: 42px;
        border: 2px solid #e1b783;
        border-radius: 20px;
        font-size: 15px;
        font-family: 'Regular', Calibri, sans-serif;
        background-color: #ffffff;
        color: #213242;
        outline: none;
    }

    .search-icon {
        position: absolute;
        top: 0;
        right: 0;
        width: 42px;
        height: 42px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .categories {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .category-btn {
        height: 30px;
        padding-left: 14px;
        padding-right: 14px;
        border: 2px solid #e1b783;
        border-radius: 18px;
        background-color: transparent;
        font-family: 'Regular', Calibri, sans-serif;
        font-size: 13px;
        color: #213242;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #213242;
        color: #ffffff;
    }

    .emoji-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        /* 1 Columna */
        gap: 12px;
        width: 100%;
    }

    .emoji-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 12px;
        background-color: #ffffff;
        border: 2px solid #e1b783;
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(225, 183, 131, 0.3);
        cursor: pointer;
        gap: 5px;
    }

    .emoji {
        font-size: 2rem;
    }

    .emoji-name {
        font-size: 0.75rem;
        color: #213242;
        text-align: center;
    }

    footer {
        display: flex;
        justify-content: center;
        padding-top: 15px;
        font-size: 0.85rem;
        color: #213242;
        text-align: center;
    }

    .notification {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background-color: #e1b783;
        color: #213242;
        padding: 10px 20px;
        border-radius: 30px;
        opacity: 0;
        transition: all 0.5s;
        z-index: 1000;
        width: 90%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        text-align: center;
        font-size: 0.95rem;
    }

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   6. MOBILE SMALL (320px - 480px)
   ======================================== */
@media (min-width: 320px) and (max-width: 480px) {
    body {
        font-family: 'Regular', Calibri, sans-serif;
        color: #213242;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .container {
        width: 280px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 0 5px;
    }

    h1 {
        font-family: 'Negrita', Calibri, sans-serif;
        font-size: 1.5rem;
        color: #213242;
        text-align: center;
        line-height: 1.3;
    }

    header p {
        font-size: 0.9rem;
        color: #213242;
        text-align: center;
    }

    .search-container {
        position: relative;
        width: 100%;
    }

    #search-input {
        width: 100%;
        height: 40px;
        padding-left: 12px;
        padding-right: 40px;
        border: 2px solid #e1b783;
        border-radius: 20px;
        font-size: 14px;
        font-family: 'Regular', Calibri, sans-serif;
        background-color: #ffffff;
        color: #213242;
        outline: none;
    }

    .search-icon {
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .categories {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .category-btn {
        height: 28px;
        padding-left: 12px;
        padding-right: 12px;
        border: 2px solid #e1b783;
        border-radius: 18px;
        background-color: transparent;
        font-family: 'Regular', Calibri, sans-serif;
        font-size: 11px;
        color: #213242;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #213242;
        color: #ffffff;
    }

    .emoji-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        /* 1 Columna */
        gap: 8px;
        width: 100%;
    }

    .emoji-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px;
        background-color: #ffffff;
        border: 2px solid #e1b783;
        border-radius: 12px;
        box-shadow: 0 4px 8px rgba(225, 183, 131, 0.3);
        cursor: pointer;
        gap: 5px;
    }

    .emoji {
        font-size: 1.8rem;
    }

    .emoji-name {
        font-size: 0.65rem;
        color: #213242;
        text-align: center;
    }

    footer {
        display: flex;
        justify-content: center;
        padding-top: 15px;
        font-size: 0.75rem;
        color: #213242;
        text-align: center;
    }

    .notification {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background-color: #e1b783;
        color: #213242;
        padding: 10px 20px;
        border-radius: 30px;
        opacity: 0;
        transition: all 0.5s;
        z-index: 1000;
        width: 90%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        text-align: center;
        font-size: 0.9rem;
    }

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   SAVED EMOJIS (Global)
   ======================================== */
.saved-emojis-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.saved-emoji-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: #ffffff;
    border: 2px solid #213242;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Tablet & Mobile Optimization */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.saved-emoji-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #f0f4f8;
}

.saved-emoji-item .emoji {
    font-size: 2rem !important;
}