/**
 * Q&A Component Styles
 * Styling for the Q&A tab content
 */

.qa-tab-content {
    min-height: 400px;
}

/* Loading State */
.qa-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.qa-loading .loading-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-salmon, #ff5757);
    border-right-color: var(--primary-salmon, #ff5757);
    border-radius: 50%;
    /* animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; */
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(255, 87, 87, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.qa-loading p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin: 0;
    animation: pulse 2s ease-in-out infinite;
}

/* Error State */
.qa-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.qa-error svg {
    color: var(--primary-salmon, #ff5757);
    margin-bottom: 20px;
}

.qa-error h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 20px;
}

.qa-error p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px 0;
}

.qa-error .retry-button {
    padding: 10px 24px;
    background: var(--primary-salmon, #ff5757);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.qa-error .retry-button:hover {
    background: #ff3d3d;
    transform: translateY(-2px);
}

/* Empty State */
.qa-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.qa-empty svg {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

.qa-empty p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin: 0;
}

/* Q&A Container */
.qa-container {
    padding: 20px 0;
}

.qa-header {
    margin-bottom: 32px;
    text-align: center;
}

.qa-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: #fff;
}

.qa-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* Q&A List */
.qa-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Q&A Item */
.qa-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Number badge for each Q&A */
.qa-item::after {
    content: attr(data-index);
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: rgba(255, 87, 87, 0.2);
    color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.qa-item:hover::after {
    background: rgba(255, 87, 87, 0.3);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.15);
}

/* Subtle gradient overlay on hover */
.qa-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 87, 87, 0.03) 0%, rgba(255, 165, 0, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.qa-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 87, 87, 0.3);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px rgba(255, 87, 87, 0.15), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.qa-item:hover::before {
    opacity: 1;
}

/* Question Section */
.qa-question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.qa-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qa-icon-question {
    background: rgba(255, 87, 87, 0.15);
    color: var(--primary-salmon, #ff5757);
}

.qa-icon-answer {
    background: rgba(255, 165, 0, 0.15);
    color: var(--secondary-orange, #ffa500);
}

/* Icon hover effects */
.qa-item:hover .qa-icon-question {
    background: rgba(255, 87, 87, 0.25);
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 87, 87, 0.3);
}

.qa-item:hover .qa-icon-answer {
    background: rgba(255, 165, 0, 0.25);
    transform: rotate(-5deg) scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 165, 0, 0.3);
}

/* Icon SVG animation */
.qa-icon svg {
    transition: transform 0.3s ease;
}

.qa-item:hover .qa-icon svg {
    transform: scale(1.1);
}

.qa-text {
    flex: 1;
    line-height: 1.6;
}

.qa-text strong {
    color: #fff;
    font-weight: 600;
    margin-right: 8px;
}

.qa-question .qa-text {
    font-size: 18px;
    color: #fff;
    font-weight: bold;
}

/* Answer Section */
.qa-answer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-left: 8px;
}

.qa-answer .qa-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

/* Mobile Responsiveness */
@media only screen and (max-width: 768px) {
    .qa-container {
        padding: 10px 0;
    }

    .qa-header h2 {
        font-size: 24px;
    }

    .qa-subtitle {
        font-size: 14px;
    }

    .qa-item {
        padding: 16px;
    }

    .qa-question .qa-text {
        font-size: 16px;
    }

    .qa-answer .qa-text {
        font-size: 14px;
    }

    .qa-icon {
        width: 32px;
        height: 32px;
    }

    .qa-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Tablet */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .qa-container {
        padding: 15px 0;
    }

    .qa-header h2 {
        font-size: 26px;
    }
}

/* ========================================
   MODERN STREAMING ANIMATIONS
   ======================================== */

/* Smooth fade-in with slide up and scale */
@keyframes streamIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(4px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.01);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

/* Shimmer effect for loading */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Pulse animation for streaming indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* Default state for Q&A items */
.qa-item {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Animation class for items entering via streaming */
.qa-item-entering {
    animation: streamIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stagger animation for sequential items */
.qa-item:nth-child(1) { animation-delay: 0s; }
.qa-item:nth-child(2) { animation-delay: 0.1s; }
.qa-item:nth-child(3) { animation-delay: 0.2s; }
.qa-item:nth-child(4) { animation-delay: 0.3s; }
.qa-item:nth-child(5) { animation-delay: 0.4s; }

/* Streaming indicator (dot pulsing) */
.qa-streaming-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(255, 87, 87, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 87, 87, 0.2);
    transition: all 0.3s ease;
}

.qa-streaming-indicator::before {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-salmon, #ff5757);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 87, 87, 0.6);
}

/* Dots animation for streaming */
@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.qa-streaming-indicator::after {
    content: '...';
    animation: dots 1.5s infinite;
    width: 20px;
    display: inline-block;
}

/* Loading skeleton for upcoming Q&A items */
.qa-skeleton {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.qa-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

.qa-skeleton-line {
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 12px;
}

.qa-skeleton-line:nth-child(1) { width: 80%; }
.qa-skeleton-line:nth-child(2) { width: 95%; }
.qa-skeleton-line:nth-child(3) { width: 70%; }
