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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tabs-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    top: 2px;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-content {
    animation: fadeIn 0.3s ease-in;
}

.upload-section {
    animation: fadeIn 0.5s ease-in;
}

.upload-box {
    text-align: center;
    padding: 60px 20px;
    border: 3px dashed #667eea;
    border-radius: 15px;
    background: #f8f9ff;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #667eea;
    stroke-width: 2;
}

.upload-box h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-box p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-control {
    background: #667eea;
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    margin: 0 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-control:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e084eb 0%, #e4475c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #e8f0fe;
    border-radius: 8px;
    color: #1967d2;
    font-weight: 500;
    display: none;
}

.file-info.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.video-section {
    animation: fadeIn 0.5s ease-in;
}

.danger-warning {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4);
    animation: warningPulse 1.5s infinite, slideDown 0.5s ease;
}

.danger-warning.show {
    display: block;
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.warning-icon {
    font-size: 3rem;
    animation: shake 0.5s infinite;
}

.warning-text h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.warning-text p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px rgba(255, 0, 0, 0.7);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.video-panels {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.video-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-panel.main-panel {
    flex: 4;
}

.video-panel.object-panel {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.panel-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.video-container {
    position: relative;
    width: 100%;
    flex: 1;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#videoStream,
#objectStream {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
}

#objectStream {
    max-height: 400px;
    max-width: 100%;
}

.video-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
}

.status-dot.paused {
    background: #ff9800;
    animation: none;
}

.status-dot.stopped {
    background: #f44336;
    animation: none;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.image-section {
    animation: fadeIn 0.5s ease-in;
}

.image-panels {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.image-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.image-panel.main-panel {
    flex: 4;
}

.image-panel.object-panel {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.image-container {
    position: relative;
    width: 100%;
    flex: 1;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#processedImage,
#detectedObjectImage {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
}

#detectedObjectImage {
    max-height: 400px;
    max-width: 100%;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-box {
        padding: 40px 15px;
    }
    
    .btn-control {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .video-panels,
    .image-panels {
        flex-direction: column;
    }
    
    .video-panel.object-panel,
    .image-panel.object-panel {
        min-width: auto;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

