/* TAI Packs Styles - Estilos específicos para packs */
/* VERSIÓN 1.5 - CON HEADER COMPLETO DE PACK */

/* ==========================================================================
   HEADER EN MODO PACK
   ========================================================================== */

.tai-chat-header.tai-pack-mode {
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2b8c 100%) !important;
    color: white !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 20px !important;
    margin-bottom: 0 !important;
    border-bottom: 4px solid #ffd700 !important;
    box-shadow: 0 4px 20px rgba(45, 27, 78, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.tai-chat-header.tai-pack-mode:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff);
    background-size: 800% 800%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tai-pack-header-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.tai-pack-header-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tai-pack-icon {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.15);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffd700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tai-pack-info {
    flex: 1;
}

.tai-pack-title {
    margin: 0 !important;
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
    line-height: 1.2 !important;
    letter-spacing: 0.5px;
}

.tai-pack-subtitle {
    font-size: 1.2rem !important;
    color: #ffd700 !important;
    font-weight: 600 !important;
    margin-top: 8px !important;
    background: rgba(255, 215, 0, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.tai-pack-header-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    flex-wrap: wrap;
    gap: 10px;
}

.tai-pack-summary {
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    flex: 1;
    min-width: 300px;
}

.tai-pack-summary strong {
    color: #ffd700;
    font-weight: 700;
}

.tai-pack-indicator {
    font-size: 0.85rem;
    background: linear-gradient(135deg, #ffd700 0%, #ff6b6b 100%);
    color: #2d1b4e !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* ==========================================================================
   BADGE PARA PACKS EN LISTA DE PROMPTS
   ========================================================================== */

.pack-badge {
    display: inline-block !important;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2b8c 100%) !important;
    color: white !important;
    font-size: 0.75rem !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    font-weight: 700 !important;
    border: 1px solid #ffd700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Indicador en selector de prompts */
.prompt-item.pack-prompt {
    border-left: 5px solid #2d1b4e !important;
    background: linear-gradient(90deg, rgba(45, 27, 78, 0.08) 0%, transparent 100%) !important;
    position: relative;
    overflow: hidden;
}

.prompt-item.pack-prompt:before {
    content: "📦 ";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.3;
    z-index: 0;
}

.prompt-item.pack-prompt .prompt-title {
    position: relative;
    z-index: 1;
    padding-left: 30px;
}

/* ==========================================================================
   CONTADOR DE CRÉDITOS EN MODO PACK
   ========================================================================== */

.credits-counter.pack-mode {
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2b8c 100%) !important;
    color: white !important;
    border: 3px solid #ffd700 !important;
    border-radius: 15px !important;
    padding: 15px 20px !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
}

.credits-counter.pack-mode .credits-label {
    color: #ffd700 !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
}

.credits-counter.pack-mode .credits-value {
    font-weight: 900 !important;
    font-size: 2rem !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================================================
   TOOLTIP PARA INFORMACIÓN DE PACK
   ========================================================================== */

.pack-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 5px;
}

.pack-tooltip .pack-tooltip-text {
    visibility: hidden;
    width: 350px;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2b8c 100%);
    color: white;
    text-align: left;
    border-radius: 12px;
    padding: 20px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid #ffd700;
    pointer-events: none;
}

.pack-tooltip .pack-tooltip-text:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: #2d1b4e transparent transparent transparent;
}

.pack-tooltip:hover .pack-tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.pack-tooltip-content h4 {
    margin: 0 0 12px 0 !important;
    color: #ffd700 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 8px;
}

.pack-tooltip-content ul {
    margin: 0 !important;
    padding-left: 20px !important;
    font-size: 0.95rem !important;
}

.pack-tooltip-content li {
    margin-bottom: 8px !important;
    padding-left: 5px;
    position: relative;
}

.pack-tooltip-content li:before {
    content: "•";
    color: #ffd700;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* ==========================================================================
   ANIMACIONES PARA TRANSICIÓN PACK/INDIVIDUAL
   ========================================================================== */

@keyframes packModeIn {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes packModeOut {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

.tai-pack-mode .tai-pack-header-container {
    animation: packModeIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tai-individual-mode .tai-chat-header > div {
    animation: packModeOut 0.4s ease-in;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 992px) {
    .tai-chat-header.tai-pack-mode {
        padding: 15px !important;
    }
    
    .tai-pack-header-main {
        gap: 15px;
    }
    
    .tai-pack-icon {
        width: 60px;
        height: 60px;
        font-size: 2.5rem;
    }
    
    .tai-pack-title {
        font-size: 1.5rem !important;
    }
    
    .tai-pack-subtitle {
        font-size: 1.1rem !important;
    }
    
    .tai-pack-summary {
        font-size: 0.95rem !important;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .tai-pack-header-main {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .tai-pack-info {
        text-align: center;
        width: 100%;
    }
    
    .tai-pack-icon {
        width: 55px;
        height: 55px;
        font-size: 2.2rem;
    }
    
    .tai-pack-title {
        font-size: 1.4rem !important;
    }
    
    .tai-pack-subtitle {
        font-size: 1rem !important;
        display: block;
        margin: 8px auto 0 auto !important;
        width: fit-content;
    }
    
    .tai-pack-header-details {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .tai-pack-summary {
        min-width: 100%;
        text-align: center;
        order: 2;
    }
    
    .tai-pack-indicator {
        order: 1;
        width: fit-content;
        margin: 0 auto;
    }
    
    .pack-tooltip .pack-tooltip-text {
        width: 280px;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 576px) {
    .tai-chat-header.tai-pack-mode {
        padding: 12px !important;
        border-radius: 8px 8px 0 0 !important;
    }
    
    .tai-pack-title {
        font-size: 1.3rem !important;
    }
    
    .tai-pack-subtitle {
        font-size: 0.95rem !important;
        padding: 5px 10px;
    }
    
    .tai-pack-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .tai-pack-summary {
        font-size: 0.9rem !important;
        padding: 8px 12px;
    }
    
    .tai-pack-indicator {
        font-size: 0.8rem;
        padding: 5px 12px;
    }
    
    .pack-badge {
        font-size: 0.7rem !important;
        padding: 3px 8px !important;
    }
}

@media (max-width: 400px) {
    .tai-pack-title {
        font-size: 1.2rem !important;
    }
    
    .tai-pack-subtitle {
        font-size: 0.9rem !important;
    }
    
    .tai-pack-summary {
        font-size: 0.85rem !important;
        padding: 6px 10px;
    }
    
    .tai-pack-icon {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   ESTILOS PARA PACK EN SELECTOR DE PROMPTS (MOBILE)
   ========================================================================== */

@media (max-width: 768px) {
    .prompt-item.pack-prompt:before {
        left: 8px;
        font-size: 1rem;
    }
    
    .prompt-item.pack-prompt .prompt-title {
        padding-left: 25px;
        font-size: 0.95rem;
    }
    
    .pack-badge {
        font-size: 0.65rem !important;
        padding: 2px 6px !important;
        margin-left: 6px !important;
    }
}

/* ==========================================================================
   EFECTOS ESPECIALES PARA PACKS
   ========================================================================== */

.tai-pack-glow {
    position: relative;
}

.tai-pack-glow:after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4, #45b7d1, #ffd700);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: glow 3s ease infinite;
    filter: blur(5px);
    opacity: 0.7;
}

@keyframes glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Highlight para pack activo */
.prompt-item.pack-prompt.active {
    background: linear-gradient(90deg, rgba(45, 27, 78, 0.15) 0%, rgba(74, 43, 140, 0.1) 100%) !important;
    border-left: 5px solid #ffd700 !important;
    box-shadow: 0 3px 10px rgba(45, 27, 78, 0.2) !important;
}

/* ==========================================================================
   ESTADOS DE PACK (CRÉDITOS BAJOS, EXPIRACIÓN PRÓXIMA)
   ========================================================================== */

.tai-pack-mode.low-credits .tai-pack-subtitle {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
    border-color: rgba(255, 107, 107, 0.3) !important;
    animation: lowCreditsPulse 1.5s infinite;
}

@keyframes lowCreditsPulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.tai-pack-mode.expiring-soon {
    border-bottom-color: #ff6b6b !important;
}

.tai-pack-mode.expiring-soon .tai-pack-icon {
    border-color: #ff6b6b;
    animation: expiringPulse 2s infinite;
}

@keyframes expiringPulse {
    0% { transform: scale(1); border-color: #ff6b6b; }
    50% { transform: scale(1.05); border-color: #ff9f43; }
    100% { transform: scale(1); border-color: #ff6b6b; }
}

/* ==========================================================================
   LOADING STATE PARA HEADER DE PACK
   ========================================================================== */

.tai-pack-header-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.tai-pack-header-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tai-pack-header-loading .loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}