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

:root {
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.7);
    --border-color: rgba(48, 54, 61, 0.5);
    --text-primary: #f0f6fc;
    --text-secondary: #aeb4bb;
    --accent: #58a6ff;
    --accent-hover: #3182ce;
    --success: #238636;
    --success-hover: #2ea043;
    --danger: #f85149;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(10px);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 768px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--danger);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.title span {
    color: var(--accent);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Form */
.extractor-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

.url-input {
    width: 100%;
    padding: 1.2rem 1rem 1.2rem 3rem;
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.15);
}

.url-input::placeholder {
    color: rgba(139, 148, 158, 0.6);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(48, 54, 61, 0.5);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(48, 54, 61, 0.8);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-hover);
}

/* States */
.hidden {
    display: none !important;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(88, 166, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

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

.error-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.4);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: #ffdce0;
    margin-bottom: 2rem;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.error-icon {
    color: var(--danger);
}

/* Result Area */
.result-area {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.result-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.result-actions i {
    width: 16px;
    height: 16px;
}

.transcript-box {
    width: 100%;
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    height: 400px;
}

.transcript-box textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.transcript-box textarea::-webkit-scrollbar {
    width: 8px;
}

.transcript-box textarea::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

footer {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: rgba(139, 148, 158, 0.5);
}

/* Responsive */
@media (max-width: 640px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .result-actions {
        width: 100%;
    }

    .result-actions .btn {
        flex: 1;
    }
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.nav-link i {
    width: 18px;
    height: 18px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(48, 54, 61, 0.4);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.2);
}

/* Thumbnail Grid */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.thumbnail-card {
    background: rgba(22, 27, 34, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.thumbnail-card:hover {
    transform: translateY(-5px);
    border-color: rgba(88, 166, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.thumbnail-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #000;
}

.thumbnail-info {
    padding: 1.2rem;
    text-align: center;
}

.thumbnail-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-download:active {
    transform: translateY(0);
}

/* Section Styling */
.section-wrapper {
    margin: 3.5rem 0;
    padding: 2.5rem;
    background: rgba(22, 27, 34, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.section-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}

.section-wrapper h2.section-title {
    font-size: 1.7rem;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-wrapper h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--accent);
    border-radius: 4px;
}

/* Features/Tools Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: rgba(13, 17, 23, 0.6);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card a {
    color: inherit;
    text-decoration: none;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(88, 166, 255, 0.4);
}

.feature-card i {
    width: 42px;
    height: 42px;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Blog Section */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-post {
    padding: 1.5rem;
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.2s, background 0.3s;
}

.blog-post:hover {
    transform: translateX(8px);
    background: rgba(22, 27, 34, 0.8);
    border-color: rgba(88, 166, 255, 0.3);
}

.blog-post h3 {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 1.2rem;
}

.blog-post p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    margin: 3.5rem 0;
    padding: 2.5rem;
    background: rgba(22, 27, 34, 0.4);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--success), transparent);
    opacity: 0.6;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    font-size: 1.7rem;
    position: relative;
    padding-bottom: 1rem;
}

.faq-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--success);
    border-radius: 4px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.faq-item {
    background: rgba(13, 17, 23, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.faq-item:hover {
    background: rgba(22, 27, 34, 0.8);
    border-color: rgba(139, 148, 158, 0.4);
}

.faq-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.faq-answer {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tool-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

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