* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --pet-color: #ec4899;
    --human-color: #10b981;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--pet-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-box {
    background: var(--card-bg);
    border: 3px dashed var(--border-color);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.file-types {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin: 10px 0;
}

/* File Preview */
.file-preview {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.preview-media {
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-media img,
.preview-media video {
    max-width: 100%;
    max-height: 400px;
    display: block;
}

.preview-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.preview-info p {
    margin: 10px 0;
    font-size: 1.1em;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-download {
    background: var(--warning-color);
    color: white;
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

.btn-download:hover {
    background: #d97706;
}

/* Processing Section */
.processing-section {
    text-align: center;
}

.processing-box {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--pet-color));
    width: 0%;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 0%; }
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-card.pets {
    border-color: var(--pet-color);
}

.stat-card.humans {
    border-color: var(--human-color);
}

.stat-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
    color: var(--primary-color);
}

.stat-card.pets .stat-value {
    color: var(--pet-color);
}

.stat-card.humans .stat-value {
    color: var(--human-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1em;
}

/* Comparison Section */
.comparison-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.media-column h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    text-align: center;
}

.media-container {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-container img,
.media-container video {
    max-width: 100%;
    max-height: 600px;
    display: block;
    width: 100%;
}

/* Error Section */
.error-section {
    text-align: center;
}

.error-box {
    background: var(--card-bg);
    border: 2px solid var(--danger-color);
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.error-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.error-box h2 {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.error-box p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .preview-content,
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
}

.tab-btn {
    padding: 12px 30px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Live Feed Styles */
.live-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.live-header h2 {
    font-size: 1.8em;
    color: var(--text-primary);
}

.live-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--border-color);
    font-size: 0.9em;
    font-weight: 600;
}

.status-indicator.connected {
    background: var(--success-color);
    color: white;
}

.live-info-box {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.live-info-box p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.live-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-badge {
    flex: 1;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.stat-badge .stat-icon {
    font-size: 1.5em;
}

.live-video-container {
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

#liveCanvas {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 10;
    background: #000;
}

.no-stream-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    z-index: 5;
}

.no-stream-icon {
    font-size: 5em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-stream-message h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.live-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.live-log h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.log-container {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.log-entry {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 5px;
    font-size: 0.9em;
}

.log-entry.pet {
    border-left-color: var(--pet-color);
}

.log-entry.human {
    border-left-color: var(--human-color);
}

.log-empty {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Scrollbar Styles */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.log-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

