/* ==========================================================================
   RmC Portfolio - Shared components
   Project card + native carousel + tech badges, used by both the home page
   (highlighted projects) and the projects page (full catalogue).
   Loaded from templates/index.html right after global.css, so page-level
   stylesheets keep overriding these rules exactly as they did before.
   ========================================================================== */

/* --- Grid ---------------------------------------------------------------- */
.proyectos-grid-wrapper {
    margin-left: 110px !important;
    margin-right: 110px !important;
    margin-top: 45px !important;
}

.proyectos-flex-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 40px !important;
    width: 100% !important;
}

.proyecto-columna {
    flex: 0 0 calc(50% - 20px) !important;
    width: calc(50% - 20px) !important;
    max-width: calc(50% - 20px) !important;
}

/* --- Project card -------------------------------------------------------- */
.project-card {
    background: var(--nav-bg) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    color: var(--text-dark) !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08) !important;
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), rgba(255, 0, 115, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 45px rgba(31, 38, 135, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.dark-mode .project-card {
    background: rgba(21, 35, 49, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--card-text) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
}

.dark-mode .project-card::after {
    background: linear-gradient(90deg, var(--logo-color), rgba(162, 155, 254, 0.3), transparent);
}

.dark-mode .project-card:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4) !important;
}

/* --- Native carousel ----------------------------------------------------- */
.native-carousel {
    position: relative !important;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.06) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .native-carousel {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover .carousel-img {
    transform: scale(1.03);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.dark-mode .project-card:hover .carousel-img {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.native-carousel-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.native-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    padding: 20px !important;
}

.native-carousel-item.active {
    opacity: 1;
    visibility: visible;
}

.carousel-img {
    width: 88% !important;
    height: 85% !important;
    object-fit: cover !important;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    cursor: zoom-in !important;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease;
}

.dark-mode .carousel-img {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-carousel-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 42px !important;
    height: 42px !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    font-size: 1.3rem !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
}

.custom-carousel-btn-prev { left: 10px !important; }
.custom-carousel-btn-next { right: 10px !important; }

.custom-carousel-btn:hover {
    background-color: var(--accent-color) !important;
    transform: translateY(-50%) scale(1.08) !important;
}

.dark-mode .custom-carousel-btn:hover { background-color: var(--logo-color) !important; }

/* --- Card body ----------------------------------------------------------- */
.card-body-custom {
    padding: 28px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.project-card .card-title,
.card-body-custom .card-title {
    color: var(--text-dark) !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-align: center !important;
}

.dark-mode .project-card .card-title,
.dark-mode .card-body-custom .card-title {
    color: var(--card-text) !important;
}

.project-card .card-text {
    color: var(--text-dark) !important;
    opacity: 0.80 !important;
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    text-align: justify !important;
    text-justify: inter-word;
}

.dark-mode .project-card .card-text {
    color: var(--card-text) !important;
}

.github-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--accent-color) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    width: fit-content !important;
    padding: 6px 16px;
    border-radius: 12px;
    background: rgba(255, 0, 115, 0.04);
    border: 1px solid rgba(255, 0, 115, 0.08);
}

.github-link:hover {
    transform: translateX(4px) !important;
    background: rgba(255, 0, 115, 0.08);
    border-color: rgba(255, 0, 115, 0.2);
    box-shadow: 0 4px 12px rgba(255, 0, 115, 0.1);
}

.dark-mode .github-link {
    color: var(--logo-color) !important;
    background: rgba(162, 155, 254, 0.05);
    border-color: rgba(162, 155, 254, 0.1);
}

.dark-mode .github-link:hover {
    background: rgba(162, 155, 254, 0.1);
    border-color: rgba(162, 155, 254, 0.2);
    box-shadow: 0 4px 12px rgba(162, 155, 254, 0.1);
}

.github-link svg { width: 16px !important; height: 16px !important; fill: currentColor !important; }

/* --- Tech badges --------------------------------------------------------- */
.project-tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 0, 115, 0.1);
    position: relative;
}

.dark-mode .project-tech-badges {
    border-top-color: rgba(162, 155, 254, 0.12);
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 0, 115, 0.1), rgba(255, 0, 115, 0.04));
    border: 1px solid rgba(255, 0, 115, 0.15);
    color: var(--text-dark);
    letter-spacing: 0.2px;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    position: relative;
}

.tech-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.7;
    flex-shrink: 0;
}

.tech-badge:hover {
    background: linear-gradient(135deg, rgba(255, 0, 115, 0.18), rgba(255, 0, 115, 0.08));
    transform: translateY(-2px) scale(1.04);
    border-color: rgba(255, 0, 115, 0.3);
    box-shadow: 0 4px 16px rgba(255, 0, 115, 0.15);
}

.dark-mode .tech-badge {
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.12), rgba(162, 155, 254, 0.05));
    border: 1px solid rgba(162, 155, 254, 0.15);
    color: var(--card-text);
}

.dark-mode .tech-badge::before {
    background: var(--logo-color);
}

.dark-mode .tech-badge:hover {
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.22), rgba(162, 155, 254, 0.1));
    border-color: rgba(162, 155, 254, 0.3);
    box-shadow: 0 4px 16px rgba(162, 155, 254, 0.15);
}


/* --- Disponibilidad y llamadas a la accion ------------------------------- */
/* Compartidas por el hero (home.html) y la pagina de contacto. En modo oscuro
   la marca es lila: el rosa queda solo como resplandor, nunca en reposo. */
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 14px;
    margin-bottom: 22px;
    border: 1px solid var(--lang-btn-border, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
    background: var(--lang-btn-bg, rgba(0, 0, 0, 0.05));
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.availability-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: availability-pulse 2.4s ease-out infinite;
}

.dark-mode .availability-dot {
    background: var(--logo-color);
    animation-name: availability-pulse-lilac;
}

@keyframes availability-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 0, 115, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(255, 0, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 115, 0); }
}

@keyframes availability-pulse-lilac {
    0%   { box-shadow: 0 0 0 0 rgba(162, 155, 254, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(162, 155, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(162, 155, 254, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .availability-dot { animation: none; }
}

.boton_cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 30px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
                border-color 0.25s ease, color 0.25s ease;
}

.boton_cta:hover,
.boton_cta:focus-visible {
    transform: translateY(-2px);
}

.boton_cta:active { transform: translateY(0); }

.boton_cta_primario {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(255, 0, 115, 0.28);
}

.boton_cta_primario:hover,
.boton_cta_primario:focus-visible {
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(255, 0, 115, 0.42);
}

.dark-mode .boton_cta_primario {
    background: var(--logo-color);
    color: #17293a;
    box-shadow: 0 8px 22px rgba(162, 155, 254, 0.3);
}

.dark-mode .boton_cta_primario:hover,
.dark-mode .boton_cta_primario:focus-visible {
    background: #8f85f1;
    color: #17293a;
    box-shadow: 0 12px 30px rgba(162, 155, 254, 0.45);
}

/* En reposo y en hover el boton conserva el color del modo: en oscuro es lila,
   nunca rosa. El feedback del hover viene del borde y del resplandor. */
.boton_cta_secundario {
    background: transparent;
    color: var(--logo-color);
    border-color: var(--lang-btn-border, rgba(0, 0, 0, 0.18));
}

.boton_cta_secundario:hover,
.boton_cta_secundario:focus-visible {
    color: var(--logo-color);
    border-color: var(--logo-color);
    box-shadow: 0 8px 20px rgba(255, 0, 115, 0.24);
}

.dark-mode .boton_cta_secundario:hover,
.dark-mode .boton_cta_secundario:focus-visible {
    box-shadow: 0 8px 22px rgba(162, 155, 254, 0.38);
}

@media (max-width: 768px) {
    .availability-badge {
        font-size: 0.78rem;
        padding: 7px 15px 7px 12px;
    }
    .boton_cta { width: 100%; }
}

/* --- Enlace de contacto en el pie ---------------------------------------- */
/* 25px para igualar el ritmo del bloque: .footer-desc deja 35px encima y los
   botones usan 13px de padding, asi que 12px hacia abajo se leia pegado al
   cuadro de correo. */
.footer-contact-link {
    display: inline-block;
    margin-top: 25px;
    padding: 8px 18px;
    border: 2px solid var(--accent-color);
    border-radius: 999px;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.footer-contact-link:hover,
.footer-contact-link:focus-visible {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(255, 0, 115, 0.3);
}

.dark-mode .footer-contact-link {
    border-color: var(--logo-color);
    color: var(--logo-color);
}

.dark-mode .footer-contact-link:hover,
.dark-mode .footer-contact-link:focus-visible {
    background: var(--logo-color);
    color: #17293a;
    box-shadow: 0 6px 18px rgba(162, 155, 254, 0.3);
}

/* --- Nota del pie en lugar del formulario duplicado ----------------------- */
.footer-form-note {
    margin: 0 0 4px;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.85;
}

.footer-form-hidden {
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .footer-contact-link {
        padding: 6px 14px !important;
    }
}