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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 16px 24px;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #374151;
    color: white;
    border: 1px solid #4b5563;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
}

.btn-ghost {
    background: transparent;
    color: #9ca3af;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-ghost:hover {
    background: #374151;
    color: #ffffff;
}

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.main-canvas {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: #0f0f0f;
}

/* Input Section */
.input-section {
    margin-bottom: 32px;
}

.input-header {
    margin-bottom: 24px;
}

.input-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-header p {
    color: #9ca3af;
    font-size: 1.1rem;
}

.textarea-container {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.textarea-container:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.textarea-container textarea {
    width: 100%;
    min-height: 300px;
    padding: 24px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    font-family: 'Inter', monospace;
}

.textarea-container textarea:focus {
    outline: none;
}

.textarea-container textarea::placeholder {
    color: #6b7280;
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #111111;
    border-top: 1px solid #374151;
}

.char-count {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Processing Section */
.processing-section {
    margin-bottom: 32px;
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 24px;
}

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

.processing-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.processing-stats {
    color: #9ca3af;
    font-size: 0.875rem;
}

.processing-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.processing-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #111111;
    border: 1px solid #374151;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.processing-item.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.processing-item.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    background: #374151;
    color: #9ca3af;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.item-description {
    color: #9ca3af;
    font-size: 0.875rem;
}

.item-actions {
    display: flex;
    gap: 8px;
}

/* Output Section */
.output-section {
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 24px;
}

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

.output-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.output-actions {
    display: flex;
    gap: 12px;
}

.output-content {
    background: #111111;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    min-height: 200px;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #111111;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.video-grid {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #6b7280;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-weight: 500;
    margin-bottom: 4px;
}

.empty-state span {
    font-size: 0.875rem;
    opacity: 0.7;
}

.video-card {
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-card:hover {
    border-color: #2563eb;
    transform: translateY(-1px);
}

.video-thumbnail {
    width: 100%;
    height: 120px;
    background: #374151;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.video-info h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffffff;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.video-duration {
    background: #000000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    width: 0%;
    transition: width 0.3s ease;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: #374151;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.step-description {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Skeleton Loading */
.skeleton-card {
    pointer-events: none;
    opacity: 0.9;
}

.skeleton-thumbnail {
    position: relative;
    background: #374151;
    overflow: hidden;
}

.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 12px;
}

.processing-spinner {
    margin-bottom: 8px;
    color: #2563eb;
}

.processing-text {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.processing-percent {
    font-size: 0.7rem;
    color: #9ca3af;
}

.skeleton-text {
    background: #374151;
    border-radius: 4px;
    height: 1em;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-text-small {
    background: #374151;
    border-radius: 3px;
    height: 0.8em;
    width: 60%;
    position: relative;
    overflow: hidden;
}

.skeleton-text::after,
.skeleton-text-small::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

/* Enhanced Progress Bar */
.processing-item .progress-bar {
    margin-top: 8px;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.processing-item .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.processing-item .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

.processing-percent {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: #2563eb;
    font-weight: 600;
}

/* Animations */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 1px solid #333;
    }
    
    .main-canvas {
        padding: 20px;
    }
}