/* ========================================
   LILIA V3.0 - RESPONSIVE
   ======================================== */

/* ========== DESKTOP (1025px+) ========== */

@media (min-width: 1025px) {
    .mobile-dock {
        display: none;
    }

    .nav-toggle {
        display: none;
    }
}

/* ========== TABLET (769px-1024px) ========== */

@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-dock {
        display: none;
    }

    .main-content {
        --app-padding-x: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========== MOBILE (0-768px) ========== */

@media (max-width: 768px) {
    .nav-container {
        position: relative;
        justify-content: space-between;
        padding: 0 1rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
        backdrop-filter: blur(30px);
        flex-direction: column;
        align-items: flex-start;
        padding: 4rem 2rem 2rem 2rem;
        gap: 0.5rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 2px solid;
        border-image: linear-gradient(180deg, #a855f7, #ec4899) 1;
        z-index: 1000;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        width: 100%;
        padding: 1rem 1.25rem;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(168, 85, 247, 0.05);
        border: 1px solid transparent;
    }

    .nav-link:hover {
        background: rgba(168, 85, 247, 0.15);
        border-color: rgba(168, 85, 247, 0.3);
        transform: translateX(5px);
        box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
    }

    .nav-link.active {
        background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
        border-color: rgba(168, 85, 247, 0.5);
        box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
        color: #fff;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 1001;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        padding: 0.75rem;
        background: rgba(168, 85, 247, 0.1);
        border: 1px solid rgba(168, 85, 247, 0.3);
        border-radius: 12px;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(10px);
    }

    .nav-toggle:hover {
        background: rgba(168, 85, 247, 0.2);
        border-color: rgba(168, 85, 247, 0.5);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
        transform: translateY(-50%) scale(1.05);
    }

    .nav-toggle.active {
        background: rgba(168, 85, 247, 0.25);
        border-color: #a855f7;
        box-shadow: 0 0 25px rgba(168, 85, 247, 0.5);
    }

    .nav-toggle span {
        width: 22px;
        height: 2.5px;
        background: linear-gradient(90deg, #a855f7, #ec4899);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
    }

    .nav-toggle.active span:first-child {
        transform: rotate(45deg) translate(5px, 5px);
        background: linear-gradient(90deg, #ec4899, #a855f7);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .nav-toggle.active span:last-child {
        transform: rotate(-45deg) translate(5px, -5px);
        background: linear-gradient(90deg, #ec4899, #a855f7);
    }

    .mobile-dock {
        display: flex;
    }

    .main-content {
        --app-padding-x: 1rem;
        --app-padding-y: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* ========== TOUCH OPTIMIZATIONS ========== */

@media (hover: none) and (pointer: coarse) {

    .btn,
    .dock-item {
        min-height: 44px;
    }

    .form-input {
        min-height: 48px;
        font-size: 16px;
        /* Evita zoom en iOS */
    }
}

/* ========== UTILITY CLASSES ======== */

.hide-mobile {
    display: none;
}

@media (min-width: 769px) {
    .hide-mobile {
        display: block;
    }
}

.show-mobile {
    display: block;
}

@media (min-width: 769px) {
    .show-mobile {
        display: none;
    }
}

/* ========== LILIA SYSTEM MOBILE OPTIMIZATIONS ========== */

@media (max-width: 768px) {

    /* CRITICAL FIX: Force solid white text - remove gradient */
    .page-title,
    .page-title *,
    h1.page-title,
    .glass-card h1,
    .glass-card .page-title {
        color: white !important;
        background: none !important;
        background-image: none !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        -webkit-text-fill-color: white !important;
        opacity: 1 !important;
    }

    /* Description text */
    .glass-card p {
        opacity: 1 !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }

    /* CRITICAL FIX: Cyborg image - push to RIGHT edge */
    img[alt="Lilia AI"],
    .glass-card img[alt="Lilia AI"] {
        position: absolute !important;
        right: -15% !important;
        left: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        height: 105% !important;
        max-height: 380px !important;
        width: auto !important;
        opacity: 0.3 !important;
        z-index: 1 !important;
    }

    /* Module Cards - hide descriptions */
    .module-card p {
        display: none !important;
    }

    .module-card {
        padding: 1.5rem !important;
        text-align: center;
    }

    /* Larger icons */
    .module-icon {
        width: 64px !important;
        height: 64px !important;
        margin: 0 auto 1rem auto !important;
    }

    .module-icon i {
        font-size: 2.5rem !important;
    }

    /* Center titles */
    .module-title {
        text-align: center;
        font-size: 1.1rem !important;
        margin-bottom: 0 !important;
    }
}