* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 2rem;
}

/* Parse Section */
.parse-section {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#videoUrl {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

#videoUrl:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.quick-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.quick-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    background: var(--background);
    border-radius: 0.25rem;
    transition: all 0.3s;
}

.quick-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Player Section */
.player-section {
    background: var(--surface);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--background);
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.video-player {
    width: 100%;
    height: 100%;
    display: block;
}

.embed-player {
    width: 100%;
    height: 100%;
    display: block;
}

/* Video Info */
.video-info {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.info-row {
    display: flex;
    margin-bottom: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.info-value {
    color: var(--text-primary);
}

/* History Section */
.history-section {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.history-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--background);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.history-item-platform {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    border-radius: 0.25rem;
    margin-right: 0.5rem;
}

.history-item-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.empty-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    transform: translateX(120%);
    transition: transform 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast-error {
    background: var(--error);
    color: white;
}

.toast-success {
    background: var(--success);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-hover);
}
