@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;900&display=swap');

:root {
    --primary: #553ED6;
    --primary-light: #7361E0;
    --primary-dark: #3E2DA1;
    --accent: #F53003;
    --bg-light: #FDFDFC;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f4f7fa;
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Internal Header --- */
.app-header {
    background-color: var(--primary) !important;
    color: white;
    padding: 0.8rem 0 0;
    /* Eliminamos padding lateral para full-width navbar */
    width: 100%;
    z-index: 1100;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 0 5% 0.8rem;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .header-top {
        gap: 0.8rem;
        padding: 0 4% 0.8rem;
        justify-content: space-between;
    }
}

.header-top .logo img {
    height: 60px;
    filter: brightness(0) invert(1);
}

@media (max-width: 576px) {
    .header-top .logo img {
        height: 45px;
    }
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 800px;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    height: 45px;
    position: relative;
}

.category-dropdown-wrapper {
    position: relative;
    height: 100%;
}

.category-dropdown {
    background: #f1f5f9;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-right: 1px solid #e2e8f0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

/* Menú Desplegable Principal */
.header-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 250px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.category-dropdown-wrapper:hover .header-dropdown-menu,
.header-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-dropdown-menu li {
    position: relative;
}

.header-dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.header-dropdown-menu a:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Submenú */
.header-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 220px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.header-dropdown-item.has-submenu:hover .header-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.search-input-wrapper input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Búsqueda en Vivo */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.search-results-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover {
    background: #f8fafc;
}

.search-item-cover {
    width: 40px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.search-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-item-info {
    flex: 1;
    overflow: hidden;
}

.search-item-info h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-info p {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-badge {
    display: inline-block;
    font-size: 0.65rem;
    background: #e0e7ff;
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-search {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0 2rem;
    height: 100%;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.btn-search:hover {
    background: var(--primary-dark);
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.action-icon {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    text-decoration: none;
}

.action-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    line-height: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: white;
}

@media (max-width: 576px) {
    .user-profile .user-info .welcome {
        display: none;
    }

    .user-profile {
        gap: 0.4rem;
    }
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .welcome {
    opacity: 0.8;
}

.user-info .account {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-profile-wrapper {
    position: relative;
}

.header-dropdown-menu.user-menu {
    left: auto;
    right: 0;
    width: 220px;
}

.header-dropdown-menu a i {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    opacity: 0.8;
}

/* Fin de estilos globales */

/* Secondary Navigation (Internal) */
.header-bottom {
    background-color: #634CE1;
    /* Tonalidad más clara oficial */
    padding: 12px 5%;
    /* Padding lateral alineado */
    margin-top: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-nav {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

@media (max-width: 768px) {
    .app-nav {
        justify-content: flex-start;
        gap: 1.5rem;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .app-nav::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .app-nav a {
        white-space: nowrap;
        font-size: 0.85rem;
    }
}

.app-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.85;
    transition: var(--transition);
    position: relative;
}

.app-nav a:hover,
.app-nav a.active {
    opacity: 1;
    color: white;
}

.app-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* --- Internal Footer --- */
.app-footer {
    background-color: #000000;
    color: white;
    padding: 4rem 8% 2rem;
    margin-top: 0;
}

/* Features Row */
.footer-top-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-item svg,
.feature-item i {
    color: var(--primary-light) !important;
    stroke: var(--primary-light);
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.feature-text h5 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    color: white;
}

.feature-text p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Main Content Row */
.footer-main-content {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr 1fr;
    gap: 4rem;
    padding-bottom: 2rem;
}

.footer-column h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column ul.links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 2rem;
    list-style: none;
}

.footer-column ul.links-grid li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-column ul.links-grid li::before {
    content: '•';
    color: var(--primary-light);
    font-size: 1.2rem;
    line-height: 1;
}

.footer-column ul.links-grid li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-column ul.links-grid li a:hover {
    color: var(--primary-light);
}

.contact-info li {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.contact-info i,
.contact-info svg {
    width: 18px;
    color: var(--primary-light) !important;
}

.contact-info li a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.contact-info li a:hover {
    color: var(--primary-light) !important;
}

.social-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-logo-img {
    height: 45px;
    filter: brightness(0) invert(1);
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    gap: 1.2rem;
}

.social-icon {
    text-decoration: none;
    transition: var(--transition);
}

.social-icon svg {
    width: 22px;
    height: 22px;
}

.social-icon.facebook svg {
    color: #1877F2;
}

.social-icon.instagram svg {
    color: #E4405F;
}

.social-icon.linkedin svg {
    color: #0A66C2;
}

.social-icon.tiktok svg {
    color: #ffffff;
}

.social-icon:hover {
    transform: translateY(-5px);
    filter: brightness(1.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

@media (max-width: 992px) {
    .footer-top-features {
        grid-template-columns: 1fr 1fr;
    }

    .footer-main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .social-col {
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0.8rem 0 0;
    }

    .search-container {
        display: flex;
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 0.5rem;
        height: 40px;
    }

    .category-dropdown {
        padding: 0 0.8rem;
        font-size: 0.8rem;
    }

    .btn-search {
        padding: 0 1rem;
    }

    .footer-top-features {
        grid-template-columns: 1fr;
    }
}

/* --- Skeleton Loader --- */
.skeleton-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.skeleton-cover {
    width: 100%;
    aspect-ratio: 2/3;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.skeleton-info {
    padding: 1rem;
}

.skeleton-title {
    height: 18px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.skeleton-subtitle {
    height: 14px;
    background: #e2e8f0;
    border-radius: 4px;
    width: 60%;
    position: relative;
    overflow: hidden;
}

/* Animacion Shimmer (Brillo) */
.skeleton-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -150%;
    }

    100% {
        left: 150%;
    }
}

/* BACK TO TOP BUTTON */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: #a3a3a3;
    color: #111;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 0.8;
    visibility: visible;
}

.back-to-top:hover {
    opacity: 1;
    background-color: #cfcfcf;
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        left: 20px;
    }
}

/* --- Auth Modal --- */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-container {
    background: white;
    width: 95%;
    max-width: 420px;
    border-radius: 28px;
    padding: 3rem 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal-overlay.active .auth-modal-container {
    transform: translateY(0);
}

.auth-modal-icon {
    width: 80px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.auth-modal-icon i,
.auth-modal-icon svg {
    width: 40px;
    height: 40px;
}

.auth-modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.auth-modal-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.auth-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-auth-login {
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    display: block;
    box-shadow: 0 10px 15px -3px rgba(85, 62, 214, 0.3);
}

.btn-auth-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -3px rgba(85, 62, 214, 0.4);
    color: white;
}

.btn-auth-cancel {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-auth-cancel:hover {
    color: var(--text-main);
}