/* IA SIDEBAR PREMIUM REDESIGN v2.1 */

.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Integrated IA Layout (3 Columns) */
.integrated-ia-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    /* Video | Materiales | IA */
    gap: 1.5rem;
    align-items: start;
}

.ia-integrated-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 2rem;
    height: calc(100vh - 12rem);
}

.ia-oracle-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ia-oracle-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.ia-refresh-pulse {
    animation: refreshPulse 1s ease;
}

@keyframes refreshPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
    }

    50% {
        transform: scale(1.02);
        filter: brightness(1.3);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* Integrated Tutor Component */
.ia-tutor-container {
    background: rgba(15, 20, 15, 0.6) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 175, 55, 0.1) !important;
    border-radius: 20px !important;
    transition: all 0.3s ease;
}

.ia-tutor-container:hover {
    border-color: rgba(212, 175, 55, 0.3) !important;
    background: rgba(15, 20, 15, 0.8) !important;
}

.ia-transcript-search {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 12px;
}

.ia-transcript-search input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    outline: none;
}

.ia-transcript-search button {
    background: var(--primary-color);
    color: black;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.ia-transcript-search button:hover {
    transform: scale(1.1);
}

.ia-results-area {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ia-empty-state {
    color: rgba(255, 255, 255, 0.3);
}

.ia-icon-pulse i {
    animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@media (max-width: 1400px) {
    .integrated-ia-layout {
        grid-template-columns: 2.5fr 1.5fr;
        /* IA colapsa abajo o se mezcla? Probemos 2 cols */
    }
}

@media (max-width: 1100px) {
    .integrated-ia-layout {
        display: flex;
        flex-direction: column;
    }

    .ia-integrated-column {
        position: static;
        height: auto;
    }
}

/* Scrollbar para resultados */
#ia-transcript-results-integrated::-webkit-scrollbar {
    width: 4px;
}

#ia-transcript-results-integrated::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

#ia-transcript-results-integrated::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.ia-transcript-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ia-transcript-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.ia-transcript-time {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    display: block;
}

.ia-transcript-text {
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.8;
}

.ia-sidebar {
    display: none;
    /* Hidden by default on PC, only active if specified or on mobile */
    width: 380px;
    height: 100vh;
    background: rgba(10, 15, 10, 0.98);
    backdrop-filter: blur(25px);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    flex-direction: column;
    z-index: 200;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.4);
}

.ia-sidebar.active {
    display: flex;
    position: fixed;
    right: 0;
    top: 0;
}

.ia-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(212, 175, 55, 0.05);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.ia-header img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px;
}

.ia-header-info strong {
    display: block;
    font-size: 0.95rem;
    color: #d4af37;
    font-family: Outfit, sans-serif;
}

.ia-header-info span {
    font-size: 0.65rem;
    color: #10b981;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ia-oracle-entry {
    padding: 1.5rem;
    padding-bottom: 0.5rem;
}

.ia-oracle-card {
    background: linear-gradient(135deg, #1a2e1a, #0a0f0a);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(212, 175, 55, 0.05);
}

.ia-oracle-card:hover {
    transform: translateY(-5px);
    border-color: #d4af37;
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.15);
    background: linear-gradient(135deg, #253d25, #0a0f0a);
}

.ia-oracle-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: #000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, 0.2);
    overflow: hidden;
}

.ia-oracle-logo img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    object-fit: contain;
}

.ia-oracle-body {
    flex: 1;
}

.ia-oracle-body strong {
    display: block;
    color: #d4af37;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.ia-oracle-body span {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 800;
    margin-top: 2px;
}

.ia-oracle-card i {
    color: #d4af37;
    font-size: 1.1rem;
    opacity: 0.7;
}

.ia-sidebar-divider {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ia-sidebar-divider::before,
.ia-sidebar-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.ia-sidebar-divider span {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 2px;
}

.ia-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.ia-transcript-search {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 0.6rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ia-transcript-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.6rem;
    outline: none;
    font-size: 0.9rem;
}

.ia-transcript-search button {
    background: #d4af37;
    color: #000;
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ia-results-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ia-result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

.ia-result-card:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateX(5px);
}

.ia-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.ia-result-time {
    background: #d4af37;
    color: #000;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 900;
}

.ia-result-nav {
    font-size: 0.65rem;
    color: #d4af37;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.5;
}

.ia-result-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.ia-result-text b {
    color: #d4af37;
}

.ia-chat-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ia-mini-chat {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ia-mini-bubble {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    max-width: 90%;
}

.ia-mini-bubble.ia {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    align-self: flex-start;
}

.ia-mini-bubble.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
}

.ia-input-group {
    display: flex;
    gap: 0.8rem;
}

.ia-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    color: white;
    outline: none;
    font-size: 0.9rem;
}

.ia-input-group button {
    background: #d4af37;
    color: #000;
    border: none;
    width: 50px;
    border-radius: 15px;
    cursor: pointer;
}

.ia-close-mobile {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    margin-left: auto;
    cursor: pointer;
}

.ia-mobile-toggle-header {
    display: none;
    background: #d4af37;
    color: black;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin-left: auto;
    cursor: pointer;
    font-size: 1.1rem;
}

@media (max-width: 1200px) {
    .ia-sidebar {
        width: 330px;
    }
}

@media (max-width: 992px) {
    .ia-sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        max-width: 450px;
        transition: right 0.3s ease;
    }

    .ia-sidebar.active {
        right: 0;
    }

    .ia-close-mobile {
        display: block;
    }

    .ia-mobile-toggle-header {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.ia-searching-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem;
    font-size: 0.8rem;
    color: #d4af37;
}

.animate-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}