/* Safari Browser Demo Fix */

/* Container and Layout */
.browser-frame-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

/* Teacher Illustration - Hidden for now to focus on demo */
.teacher-illustration {
    display: none;
}

/* Safari Browser Frame */
.safari-browser {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Browser Header */
.browser-header {
    background: linear-gradient(180deg, #f6f6f6 0%, #e8e8e8 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #d0d0d0;
    gap: 1rem;
}

.browser-controls {
    display: flex;
    gap: 8px;
}

.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.browser-dot.red { 
    background: #ff5f57; 
}

.browser-dot.yellow { 
    background: #ffbd2e; 
}

.browser-dot.green { 
    background: #28ca42; 
}

.browser-address-bar {
    flex: 1;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d0d0d0;
}

.lock-icon {
    color: #10b981;
    font-size: 14px;
}

.browser-url {
    color: #6b7280;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Browser Content */
.browser-content {
    background: #ffffff;
    height: 600px;
    overflow: hidden;
}

/* AI Detection Interface */
.ai-detection-interface {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    height: 100%;
    background: #fafafa;
}

/* Student Essay Panel */
.student-essay-panel {
    background: white;
    padding: 24px;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    height: 100%;
}

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

.student-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-pic {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.student-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.essay-timestamp {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

.essay-metadata {
    color: #6b7280;
    font-size: 12px;
}

.essay-doc-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

/* Essay Paragraphs */
.essay-paragraph {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #374151;
    padding: 12px;
    border-radius: 8px;
    position: relative;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9fafb;
    border: 1px solid transparent;
}

.essay-paragraph.scanning {
    background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: scanWave 2s linear infinite;
    border-color: #3b82f6;
}

@keyframes scanWave {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.essay-paragraph.ai-detected {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.essay-paragraph.plagiarism-detected {
    background: #fee2e2;
    border-left: 3px solid #ef4444;
}

.essay-paragraph.original {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
}

/* Detection Labels */
.detection-label {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.ai-label {
    background: #f59e0b;
    color: white;
}

.source-label {
    background: #ef4444;
    color: white;
}

/* AI Analysis Panel */
.ai-analysis-panel {
    background: #f8f9fa;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    height: 100%;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.analysis-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #dcfce7;
    border-radius: 20px;
    font-size: 12px;
    color: #166534;
    font-weight: 500;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Integrity Score */
.integrity-score-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.score-visual {
    width: 120px;
    height: 120px;
    position: relative;
}

.score-ring {
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-dasharray: 283;
    stroke-dashoffset: 99;
    animation: fillRing 2s ease forwards;
}

@keyframes fillRing {
    from { stroke-dashoffset: 283; }
    to { stroke-dashoffset: 99; }
}

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

.score-percent {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.score-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Detection Stats */
.detection-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-icon.original { 
    background: #dcfce7; 
    color: #10b981;
}

.stat-icon.ai { 
    background: #fef3c7; 
}

.stat-icon.plagiarized { 
    background: #fee2e2; 
}

.stat-icon.mixed { 
    background: #e0e7ff; 
}

.stat-details {
    flex: 1;
}

.stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

/* Source Matches */
.source-matches {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.matches-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.match-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.match-item:last-child {
    border-bottom: none;
}

.match-source {
    flex: 1;
    color: #374151;
}

.match-confidence {
    color: #6b7280;
    font-size: 11px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Teacher Actions */
.teacher-actions-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.action-btn-compact {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: #374151;
    font-weight: 500;
}

.action-btn-compact:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 1024px) {
    .ai-detection-interface {
        grid-template-columns: 1fr;
    }
    
    .student-essay-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 400px;
    }
    
    .browser-content {
        height: auto;
    }
}

@media (max-width: 768px) {
    .detection-stats {
        grid-template-columns: 1fr;
    }
    
    .teacher-actions-compact {
        grid-template-columns: 1fr;
    }
    
    .essay-paragraph {
        font-size: 13px;
        padding: 10px;
    }
}