/* IMPORTACIONES */
@import url('poppins-fonts.css');
@import url(variables.css);

* {
    outline: none;
    box-sizing: border-box;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #3498db;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    display: flex;
    flex-direction: column;
    max-width: 93%;
    height: 100vh;
    margin: 0 auto;
    overflow-y: auto;
    background-color: var(--background-color);
    color: var(--text-color);
}


/* ESTILOS NAVBAR */
.navbar {
    background-color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.navbar-header {
    color: #fff;
    font-weight: bold;
}

.nav-links {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 20px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links li a:hover {
    background-color: #ddd;
    color: black;
    transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
}

.nav-links li a i {
    margin-right: 8px;
}

@media screen and (max-width: 600px) {
    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-links li a {
        text-align: left;
        padding: 10px;
        width: 100%;
    }
}


/* ESTILO HERO */
.hero {
    position: relative;
    background-color: #2a2b38;
    color: #c4c3ca;
    border-radius: 10px;
    background-image: url('../img/hero/pat.svg');
    background-position: bottom center;
    text-align: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
    margin-bottom: 20px;
}

.hero-content h1 {
    margin: 0 0 20px;
    font-size: 2.5em;
}

.hero-content p {
    margin: 0 0 10px;
    font-size: 1.2em;
}

.hero-animate {
    animation: zoomIn 1s ease-out;
}


/* Estilos para las cards */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.card h1 {
    font-size: 1.5em;
    color: #333;
}

.card ul {
    list-style: none;
    padding: 0;
}

.card ul li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.card ul li:hover {
    background-color: #f8f9fa;
}

.card ul li:last-child {
    border-bottom: none;
}

.card a:link,
.card a:visited {
    color: #007bff;
    text-decoration: none;
}

.card a:hover,
.card a:active {
    color: #0056b3;
}

.container {
    padding: 20px;
}

/* Estilos para el Contenedor de Búsqueda */
.search-container {
    margin: 20px 0;
}

.search-container input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-container input[type="text"]:focus {
    border-color: #333;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* Estilos para los Botones de Categorías */
.categories {
    text-align: center;
    margin-bottom: 20px;
}

.category-btn {
    padding: 10px 20px;
    margin: 0 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-btn:hover,
.category-btn:focus {
    background-color: #0056b3;
}

/* ESTILOS CUADRICULA */

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-gap: 20px;
    padding: 20px 0;
}

/* Estilos para cada tarjeta */
.codigo-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.codigo-item a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    padding: 15px;
    display: block;
    flex-grow: 1;
}

.apunte-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.apunte-item a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    padding: 15px;
    display: block;
    flex-grow: 1;
}

.codigo-item:hover, .apunte-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.codigo-item:hover a, .apunte-item:hover a {
    color: #007BFF;
}

.badge-java,
.badge-html,
.badge-css {
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* Colores para las badges específicas */
.badge-java { background-color: #dd5144; }
.badge-html { background-color: #f06529; }
.badge-css  { background-color: #264de4; }


.video-container {
    overflow: hidden;
    padding-top: 56.25%;
    position: relative;
    margin-top: 20px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.badge-java {
    color: #fff;
    background-color: #5382a1;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 10px;
    user-select: none !important;
}

.badge-html {
    color: #fff;
    background-color: #f16529;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 10px;
    user-select: none !important;
}

.badge-css {
    color: #fff;
    background-color: #33aadd;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 10px;
    user-select: none !important;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    transform: translateY(-20px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: #333;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content.show {
    transform: translateY(0);
    opacity: 1;
}

.modal-content p {
    font-size: 18px;
    color: #555;
    margin-top: 15px;
    line-height: 1.6;
}

.modal-content {
    border: 1px solid rgba(0, 0, 0, 0.1);
}


/* ESTILOS PARA CÓDIGOS */
pre {
    background-color: #f7f7f7;
    border: 1px solid #e1e1e8;
    border-radius: 5px;
    padding: 20px;
    overflow-x: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

.copy-btn,
.download-btn {
    cursor: pointer;
    padding: 8px 16px;
    margin-top: 10px;
    background-color: #007bff;
    /* Azul */
    color: white !important;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    line-height: 1.5;
    font-family: inherit;
}

.download-btn:hover,
.copy-btn:hover {
    background-color: #0056b3;
}

/* ESTILOS PARA EL FOOTER */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    background-color: #333;
    color: #c4c3ca;
    padding: 20px;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    user-select: none;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo {
    max-width: 50px;
    margin-right: 10px;
}

.teramont-logo {
    max-width: 120px;
}

.footer-right a {
    color: #c4c3ca;
    text-decoration: none;
}

.footer-right a:hover {
    text-decoration: underline;
}


@media (max-width: 768px) {
    footer {
        flex-direction: column;
    }

    .footer-left,
    .footer-right {
        margin: 10px 0;
    }
}


/* ANIMACIONES */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1.5s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}