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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

main {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

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

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

.tab-content {
    display: none;
}

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

/* Buttons */
.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.icon {
    font-size: 1.25rem;
}

/* Record Section */
.record-section {
    text-align: center;
    padding: 2rem 0;
}

.record-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.status-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    font-weight: 500;
}

.status-message.recording {
    background: #fef2f2;
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.status-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

#audioPlayback {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
    display: block;
}

/* Upload Section */
.upload-section {
    padding: 2rem 0;
}

/* YouTube Section */
.youtube-section {
    padding: 2rem 0;
}

.youtube-input-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.youtube-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.5rem;
    color: var(--text-primary);
}

.youtube-input::placeholder {
    color: var(--text-secondary);
}

.video-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.video-preview img {
    box-shadow: var(--shadow);
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #f8f9ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem !important;
    color: var(--text-secondary);
}

.file-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.file-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Summary Section */
.summary-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.summary-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.summary-content {
    background: #f8f9ff;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
}

.summary-content h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.summary-content h3:first-child {
    margin-top: 0;
}

.summary-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.summary-content ul {
    list-style: none;
    padding-left: 0;
}

.summary-content li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.summary-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.5rem;
    line-height: 1;
}

/* Loader */
.loader {
    text-align: center;
    padding: 2rem;
}

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

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

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 1.5rem;
    }

    .record-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab-btn {
        padding: 0.75rem;
    }
}
