/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: #3b82f6;
}

.logo i {
    font-size: 1.75rem;
}

.logo small {
    font-size: 0.75rem;
    font-weight: 400;
    color: #64748b;
    margin-left: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.notification-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.profile-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    padding-bottom: 100px; /* Space for bottom nav */
}

/* Smart Input Section */
.input-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.input-tab.active {
    background: #3b82f6;
    color: white;
}

.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-field {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.analyze-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analyze-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.input-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-btn {
    background: #f1f5f9;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #3b82f6;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.quick-action {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.quick-action:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.quick-action.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.quick-action.primary:hover {
    background: #2563eb;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.card:hover {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-action {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.card-action:hover {
    color: #3b82f6;
    background: #f1f5f9;
}

/* Credibility Badges */
.credibility-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.badge.verified {
    background: #dcfce7;
    color: #166534;
}

.badge.review {
    background: #fef3c7;
    color: #92400e;
}

.badge.disputed {
    background: #fee2e2;
    color: #991b1b;
}

.badge.credible {
    background: #dbeafe;
    color: #1e40af;
}

.badge.fact-checked {
    background: #e0e7ff;
    color: #3730a3;
}

.badge.low-bias {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Story Cards */
.story-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.story-card:hover {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.story-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.story-summary {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.story-time {
    color: #94a3b8;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.story-views {
    color: #94a3b8;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.get-context-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.get-context-btn:hover {
    background: #2563eb;
}

/* Community Insights */
.insight-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    margin-bottom: 1rem;
}

.insight-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.add-insight-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-insight-btn:hover {
    background: #2563eb;
}

.insight-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.insight-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.insight-author {
    font-weight: 600;
    color: #1e293b;
}

.insight-badge {
    background: #3b82f6;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.insight-rating {
    color: #f59e0b;
    font-size: 0.875rem;
}

.insight-text {
    color: #475569;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.insight-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.insight-action {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.insight-action:hover {
    color: #3b82f6;
    background: #f1f5f9;
}

/* Progress Card */
.progress-card {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.progress-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.progress-content {
    position: relative;
    z-index: 1;
}

.progress-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-level {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    font-size: 0.875rem;
    opacity: 0.9;
}

.progress-points {
    font-weight: 600;
    font-size: 1.125rem;
}

.progress-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.3;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s;
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 60px;
}

.nav-item:hover {
    color: #3b82f6;
    background: #f1f5f9;
}

.nav-item.active {
    color: #3b82f6;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 200;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: min(900px, 95vw);
    max-height: 85vh;
    overflow: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.98;
    position: relative;
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 6px;
    cursor: pointer;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #111827;
}

.modal-content { padding: 1.25rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .input-section {
        padding: 1.5rem;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .quick-actions {
        flex-wrap: wrap;
    }
    
    .credibility-badges {
        gap: 0.25rem;
    }
    
    .story-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo small {
        display: none;
    }
    
    .input-tabs {
        flex-wrap: wrap;
    }
    
    .card {
        padding: 1rem;
    }
    
    .story-card {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .story-card {
    animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #3b82f6;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Video Analysis Styles */
.video-result {
    border-left: 4px solid #ef4444;
}

.video-result .result-header h3 i {
    color: #ef4444;
}

.source-info {
    font-size: 0.85rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.transcript-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.transcript-content {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
    padding: 0.5rem 0;
}

.analysis-result-card.video-result .summary-section h4 {
    color: #ef4444;
}

/* Enhanced modal styles for analysis results */
.analysis-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.analysis-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
}

.analysis-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analysis-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.analysis-modal-content {
    padding: 1.5rem;
}

/* File Upload Styles */
.file-upload-area {
    width: 100%;
    margin-bottom: 1rem;
}

.file-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-box:hover {
    border-color: #3b82f6;
    background: #f1f5f9;
}

.file-upload-box.dragover {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: scale(1.02);
}

.file-upload-box i {
    font-size: 2.5rem;
    color: #64748b;
    margin-bottom: 1rem;
    display: block;
}

.file-upload-box p {
    font-size: 1.1rem;
    color: #475569;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.file-upload-box small {
    color: #64748b;
    font-size: 0.875rem;
}

.file-info {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-details i {
    color: #3b82f6;
    font-size: 1.25rem;
}

.file-name {
    font-weight: 500;
    color: #1e293b;
}

.file-size {
    color: #64748b;
    font-size: 0.875rem;
}

.remove-file-btn {
    background: #fee2e2;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #dc2626;
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    background: #fecaca;
    transform: scale(1.1);
}

.upload-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.upload-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.upload-btn:active {
    transform: translateY(0);
}

/* Media input container specific styles */
.media-input-container {
    flex-direction: column;
    gap: 1rem;
}

.media-input-container .analyze-btn {
    background: #059669;
    color: white;
}

.media-input-container .analyze-btn:hover {
    background: #047857;
}
