/* Compact AI Detection Demo */
.ai-interactive-demo {
    padding: 3rem 0;
    background: #f8f9fa;
}

.demo-wrapper {
    max-width: 1400px;
    margin: 2rem auto;
    position: relative;
}

.demo-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Compact App Interface */
.app-interface {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: #1f2937;
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-nav {
    display: flex;
    gap: 2rem;
}

.nav-item {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.nav-item.active {
    color: white;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Compact Content Area */
.app-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Mini Sidebar */
.app-sidebar {
    width: 60px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-icon:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar-icon.active {
    background: var(--primary);
    color: white;
}

/* Main Content Panel */
.main-panel {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Essay Section */
.essay-section {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 100%;
}

.essay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.essay-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.student-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.check-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.check-button.checking {
    background: #fbbf24;
    animation: pulse 1s infinite;
}

/* Compact Essay Display */
.essay-text {
    background: #fafafa;
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.essay-paragraph {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.6;
    transition: all 0.3s;
    position: relative;
    border-left: 3px solid transparent;
}

.essay-paragraph.scanning {
    background: rgba(99, 102, 241, 0.05);
    animation: scanPulse 1s ease;
}

@keyframes scanPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

.essay-paragraph.original {
    background: rgba(16, 185, 129, 0.05);
    border-left-color: #10b981;
}

.essay-paragraph.ai-detected {
    background: rgba(99, 102, 241, 0.05);
    border-left-color: #6366f1;
}

.essay-paragraph.source-detected {
    background: rgba(245, 158, 11, 0.05);
    border-left-color: #f59e0b;
}

.para-label {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.essay-paragraph.detected .para-label {
    opacity: 1;
}

.label-ai {
    background: rgba(99, 102, 241, 0.2);
    color: #4f46e5;
}

.label-source {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.label-original {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

/* Results Panel */
.results-section {
    width: 320px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-hidden {
    display: none;
}

.results-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.analysis-time {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Compact Score Display */
.score-visual {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.score-circle-mini {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
}

.score-circle-mini svg {
    transform: rotate(-90deg);
}

.score-text-mini {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number-mini {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.score-label-mini {
    font-size: 0.65rem;
    color: #6b7280;
}

/* Compact Breakdown */
.breakdown-mini {
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.breakdown-mini h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.breakdown-item-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.75rem;
}

.breakdown-bar-mini {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill-mini {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.bar-original { background: #10b981; }
.bar-ai { background: #6366f1; }
.bar-source { background: #f59e0b; }

.breakdown-value {
    font-weight: 600;
    color: #374151;
    min-width: 35px;
    text-align: right;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.action-btn-mini {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.action-btn-mini:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Instructions */
.demo-instructions {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #065f46;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .app-interface {
        height: auto;
        min-height: 500px;
    }
    
    .app-content {
        flex-direction: column;
    }
    
    .app-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 0.5rem;
        justify-content: center;
    }
    
    .main-panel {
        flex-direction: column;
    }
    
    .essay-section {
        max-height: 400px;
    }
    
    .results-section {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}