/**
 * B2C Demo Modal Styles — Individual Learner Theme
 * Purple/Navy gradient theme matching portal-individual-landing_V4.html
 * Skovia by AITech Cloud Inc.
 */

/* ===== Overlay ===== */
.demo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.demo-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Modal Container ===== */
.demo-modal {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 780px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.demo-modal-overlay.active .demo-modal {
    transform: scale(1) translateY(0);
}

/* ===== Header ===== */
.demo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #7c3aed 100%);
    color: #fff;
}

.demo-modal-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.demo-modal-controls {
    display: flex;
    gap: 0.5rem;
}

.demo-control-btn,
.demo-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.demo-control-btn:hover,
.demo-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Content Area ===== */
.demo-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.25rem;
    min-height: 340px;
    position: relative;
}

/* ===== Scenes ===== */
.demo-scene {
    display: none;
    animation: fadeSlideIn 0.4s ease forwards;
}

.demo-scene.active {
    display: block;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Scene: Upload Content ===== */
.upload-demo-area {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 2px dashed #7c3aed;
    border-radius: 14px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s ease;
    margin-bottom: 1rem;
}

.upload-demo-area.processing {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.upload-demo-area .upload-icon {
    font-size: 2.5rem;
    color: #7c3aed;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.upload-demo-area.processing .upload-icon {
    color: #10b981;
}

.upload-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.upload-file-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
}

.upload-file-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.upload-file-item i {
    color: #7c3aed;
}

.processing-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.processing-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 3px;
    transition: width 1.5s ease;
}

.processing-bar-fill.complete {
    width: 100%;
}

/* ===== Scene: AI Generates Cards ===== */
.generated-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gen-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gen-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.gen-card.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.gen-card .card-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7c3aed;
    margin-bottom: 0.5rem;
}

.gen-card .card-content {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.5;
}

.gen-card .card-icon {
    font-size: 1.5rem;
    color: #7c3aed;
    margin-bottom: 0.5rem;
}

/* ===== Scene: AI Tutor Chat ===== */
.chat-demo-container {
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.chat-msg {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s ease;
}

.chat-msg.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-msg.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.chat-msg.user .chat-avatar {
    background: #7c3aed;
    color: #fff;
}

.chat-msg.ai .chat-avatar {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.chat-msg.user .chat-bubble {
    background: #7c3aed;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.ai .chat-bubble {
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7c3aed;
    animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ===== Scene: Study Plan ===== */
.study-plan-container {
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.plan-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.plan-header-text h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.plan-header-text small {
    color: #64748b;
    font-size: 0.75rem;
}

.plan-day {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.35s ease;
}

.plan-day.visible {
    opacity: 1;
    transform: translateX(0);
}

.plan-day:last-child {
    border-bottom: none;
}

.plan-day-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #7c3aed;
    min-width: 50px;
}

.plan-day-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.plan-day-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    width: 0%;
    transition: width 0.8s ease;
}

.plan-day-topic {
    font-size: 0.8rem;
    color: #334155;
    min-width: 120px;
}

/* ===== Scene: Progress Dashboard ===== */
.progress-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.progress-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease;
}

.progress-stat.visible {
    opacity: 1;
    transform: scale(1);
}

.progress-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.progress-chart {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.progress-chart.visible {
    opacity: 1;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 100px;
    padding-top: 0.5rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #7c3aed, #a78bfa);
    border-radius: 4px 4px 0 0;
    height: 0%;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chart-bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #64748b;
    white-space: nowrap;
}

/* ===== Scene: CTA ===== */
.cta-scene-content {
    text-align: center;
    padding: 2rem 1rem;
}

.cta-scene-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.cta-scene-content p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

.cta-btn-secondary {
    background: #fff;
    color: #7c3aed;
    border: 2px solid #7c3aed;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-btn-secondary:hover {
    transform: translateY(-2px);
    background: #f5f3ff;
}

/* ===== Footer / Progress ===== */
.demo-modal-footer {
    padding: 1rem 1.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.progress-section {
    margin-bottom: 0.75rem;
}

.progress-bar-container {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 3px;
    transition: width 0.15s linear;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748b;
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-btn,
.nav-btn-skip {
    background: none;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-btn:hover:not(:disabled),
.nav-btn-skip:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn-skip {
    border-color: #7c3aed;
    color: #7c3aed;
}

/* ===== Scene Title ===== */
.scene-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.scene-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .demo-modal {
        width: 96%;
        max-height: 92vh;
        border-radius: 14px;
    }

    .demo-content-area {
        padding: 1.5rem 1.25rem;
        min-height: 280px;
    }

    .progress-dashboard {
        grid-template-columns: 1fr;
    }

    .generated-cards-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-btn-primary,
    .cta-btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
