:root {
    --bg-color: #080b11;
    --card-bg: rgba(17, 22, 39, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-color: #f9fafb;
    --text-secondary: #9ca3af;
    --primary: #00f2fe;
    --secondary: #fe0979;
    --accent: #4f46e5;
    --glow: 0 0 25px rgba(0, 242, 254, 0.35);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(circle at 50% 0%, #17153b 0%, var(--bg-color) 75%);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-slideup {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Landing Page Layout Containers */
.section {
    padding: 6rem 1.5rem;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    z-index: 10;
    position: relative;
}

/* Sticky Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 0.85rem 2rem;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(8, 11, 17, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.55rem 2rem;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 10%, var(--secondary) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.btn-nav-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #080b11;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

/* Hero section */
.hero-section {
    padding-top: 6rem;
    padding-bottom: 2rem;
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.5rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary) 10%, var(--secondary) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 700px;
}

.hero-highlights {
    display: flex;
    gap: 20px;
    margin-top: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb;
    font-weight: 500;
    font-size: 0.85rem;
}

.highlight-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.hero-app {
    width: 100%;
}

/* Stats Section */
.stats-bar {
    padding: 3rem 1.5rem;
    background: rgba(17, 22, 39, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Features Section */
.features-section {
    background: rgba(8, 11, 17, 0.5);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.feature-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 242, 254, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.feature-card:nth-child(even) .feature-icon-container {
    background: rgba(254, 9, 121, 0.08);
    color: var(--secondary);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

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

/* Steps Section */
.steps-section {
    background: radial-gradient(circle at 10% 90%, rgba(79, 70, 229, 0.05) 0%, transparent 50%);
}

.steps-timeline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    position: relative;
}

.step-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition);
}

.step-item:hover {
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.05);
}

.step-number {
    position: absolute;
    top: -24px;
    left: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #080b11;
    font-weight: 800;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.step-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

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

/* FAQ Accordion Section */
.faq-section {
    background: rgba(8, 11, 17, 0.5);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    user-select: none;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1); /* dynamic slide */
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-answer-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-icon-arrow {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.faq-item.active {
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.faq-item.active .faq-icon-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-item.active .faq-answer {
    max-height: 1000px; /* arbitrary height to slide down */
    transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
}

/* App Tool Styling - Integrated in Hero */
.main-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.main-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.6);
}

.input-group {
    display: flex;
    gap: 10px;
    background: rgba(8, 10, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: var(--glow);
    background: rgba(8, 10, 18, 0.8);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.95rem;
    padding: 10px 14px;
    width: 100%;
}

.input-group input::placeholder {
    color: #4b5563;
}

.btn-fetch {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #080b11;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-fetch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 242, 254, 0.4);
    filter: brightness(1.15);
}

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

.btn-fetch:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading state styles */
.loading {
    display: none;
    text-align: center;
    padding: 2.5rem 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    animation: fadeIn 0.4s ease;
    margin-top: 1.5rem;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: pulse 1.8s infinite ease-in-out;
}

/* Result section styles */
.result-card {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 1.5rem;
}

.result-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.video-preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.video-preview {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 9/16;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.author-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.author-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
}

.video-desc {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    word-break: break-word;
}

.stats-badges {
    display: flex;
    gap: 10px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-badge svg {
    color: var(--text-secondary);
}

.formats-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.formats-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    border-radius: 12px;
    transition: var(--transition);
}

.format-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.format-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.format-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 242, 254, 0.08);
    border-radius: 8px;
    color: var(--primary);
    flex-shrink: 0;
}

.format-icon.audio {
    background: rgba(254, 9, 121, 0.08);
    color: var(--secondary);
}

.format-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.format-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.format-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-format-dl {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-format-dl:hover {
    background: var(--primary);
    color: #080b11;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 242, 254, 0.25);
}

.btn-format-dl.audio:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 10px rgba(254, 9, 121, 0.25);
}

/* ── Inline Audio Preview Player ─────────────────────────────────────────── */

/* Hàng nhạc: format-left chiếm toàn bộ chiều rộng, actions ở bên phải */
.music-preview-row {
    flex-wrap: wrap;
    gap: 8px;
}

.music-preview-row .format-left {
    flex: 1 1 0;
    min-width: 0;
}

/* Nhóm nút: Play + Download xếp ngang, không thu nhỏ */
.format-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Nút Play/Pause */
.btn-play-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid rgba(254, 9, 121, 0.35);
    background: rgba(254, 9, 121, 0.08);
    color: var(--secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-play-preview:hover {
    background: rgba(254, 9, 121, 0.2);
    border-color: var(--secondary);
    box-shadow: 0 4px 10px rgba(254, 9, 121, 0.25);
}

.btn-play-preview.is-playing {
    background: linear-gradient(135deg, rgba(254, 9, 121, 0.25) 0%, rgba(255, 80, 80, 0.15) 100%);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(254, 9, 121, 0.3);
    animation: pulse-pink 1.8s ease-in-out infinite;
}

.btn-play-preview:disabled {
    opacity: 0.6;
    cursor: wait;
}

@keyframes pulse-pink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(254, 9, 121, 0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(254, 9, 121, 0); }
}

/* Thanh tiến trình + thời gian */
.audio-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.audio-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    cursor: pointer;
    position: relative;
}

.audio-progress-track:hover {
    height: 6px;
    transition: height 0.15s ease;
}

.audio-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), #ff6b6b);
    border-radius: 99px;
    transition: width 0.25s linear;
    pointer-events: none;
}

.audio-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: left 0.25s linear, opacity 0.15s ease, width 0.1s ease, height 0.1s ease;
    opacity: 0;
    pointer-events: none;
}

.audio-progress-track:hover .audio-progress-handle,
.audio-progress-track.is-dragging .audio-progress-handle {
    opacity: 1;
    width: 12px;
    height: 12px;
}

/* Disable transitions when dragging to prevent delay/lag */
.audio-progress-track.is-dragging .audio-progress-fill,
.audio-progress-track.is-dragging .audio-progress-handle {
    transition: none !important;
}

.audio-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 72px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Light mode overrides */
:root[data-theme="light"] .btn-play-preview {
    background: rgba(254, 9, 121, 0.06);
    border-color: rgba(254, 9, 121, 0.3);
}

:root[data-theme="light"] .audio-progress-track {
    background: rgba(0, 0, 0, 0.1);
}

/* History Log Section */
.history-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    margin-top: 1.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.history-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-clear:hover {
    color: var(--secondary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.01);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.history-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.history-actions {
    display: flex;
    gap: 6px;
}

.btn-action-small {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-action-small:hover {
    background: var(--primary);
    color: #080b11;
}

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

.empty-history {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Toast popup notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(16, 185, 129, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

/* Footer styling */
.footer {
    background: rgba(8, 11, 17, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 4rem 1.5rem 2rem 1.5rem;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 3rem;
    margin-bottom: 2rem;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 10%, var(--secondary) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-links-col h4 {
    font-size: 1rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    color: #4b5563;
    font-size: 0.85rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-link {
    color: #4b5563;
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom-link:hover {
    color: var(--text-secondary);
}

/* Responsive Grid and Spacing adjustments */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-badge {
        align-self: center;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-highlights {
        align-items: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-timeline {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }
    
    .step-number {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .step-item {
        text-align: center;
        padding-top: 3rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 4rem 1rem;
    }
    
    .navbar {
        padding: 1rem;
    }
    
    .nav-menu {
        display: none; /* Hide standard menu on mobile for simplicity */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile optimizations for format download rows */
@media (max-width: 480px) {
    .format-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .format-left {
        width: 100%;
    }
    
    .btn-format-dl {
        justify-content: center;
        width: 100%;
        padding: 8px 12px;
    }

    .format-actions {
        width: 100%;
        gap: 8px;
    }

    .format-actions .btn-play-preview,
    .format-actions .btn-format-dl {
        flex: 1;
        width: 50%;
        justify-content: center;
        padding: 8px 12px;
    }

    /* Mobile optimizations for batch download items */
    .batch-item-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }
    
    .batch-item-left {
        width: 100%;
    }
    
    .batch-item-actions {
        width: 100%;
        flex-direction: column; /* Xếp dọc các cụm nút hành động */
        align-items: stretch;
        gap: 8px;
    }
    
    .batch-btn-group {
        width: 100%;
        display: flex;
    }
    
    .batch-btn-group .btn-main-dl {
        flex: 1;
        justify-content: center;
        white-space: nowrap; /* Ngăn chặn chữ bị bẻ dòng co rúm */
    }
    
    .btn-batch-dl-small {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

/* --- Light Theme Support (beautiful, high contrast, clean design) --- */
:root[data-theme="light"] {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: rgba(15, 23, 42, 0.08);
    --text-color: #0f172a;
    --text-secondary: #475569;
    --primary: #0284c7;
    --secondary: #db2777;
    --accent: #4f46e5;
    --glow: 0 10px 30px rgba(2, 132, 199, 0.12);
}

body {
    transition: background 0.3s ease, color 0.3s ease;
}

:root[data-theme="light"] body {
    background: radial-gradient(circle at 50% 0%, #e0f2fe 0%, var(--bg-color) 75%);
}

:root[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, #0f172a 40%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


:root[data-theme="light"] .btn-nav-action {
    background: rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .btn-nav-action:hover {
    background: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .highlight-item {
    color: var(--text-secondary);
}

:root[data-theme="light"] .input-group {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .input-group:focus-within {
    background: rgba(15, 23, 42, 0.06);
    border-color: var(--primary);
}

:root[data-theme="light"] .input-group input::placeholder {
    color: #94a3b8;
}

:root[data-theme="light"] .btn-mp3 {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-color);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .btn-mp3:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] .features-section {
    background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="light"] .feature-card:hover,
:root[data-theme="light"] .main-card:hover {
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: var(--glow);
}

:root[data-theme="light"] .step-item:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.08);
}

:root[data-theme="light"] .faq-section {
    background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="light"] .faq-item:hover {
    border-color: rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] .faq-item.active {
    border-color: rgba(2, 132, 199, 0.3);
}

:root[data-theme="light"] .footer {
    background: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .footer-grid {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .footer-bottom,
:root[data-theme="light"] .footer-bottom-link {
    color: #64748b;
}

:root[data-theme="light"] .footer-bottom-link:hover {
    color: var(--text-color);
}

:root[data-theme="light"] .format-row {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .format-row:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .history-item {
    background: rgba(15, 23, 42, 0.01);
    border-color: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .history-item:hover {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .history-list::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.25);
}

:root[data-theme="light"] .images-grid {
    background: transparent;
}

/* Light Mode overrides for Navigation Tabs and Batch Mode */
:root[data-theme="light"] .download-tabs {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .tab-btn {
    color: rgba(15, 23, 42, 0.6);
}

:root[data-theme="light"] .tab-btn:hover {
    color: rgba(15, 23, 42, 0.9);
    background: rgba(15, 23, 42, 0.03);
}

:root[data-theme="light"] .tab-btn.active {
    background: #ffffff;
    color: #3b82f6; /* Slate/blue primary color for light theme */
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .batch-textarea-wrapper {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .batch-textarea-wrapper:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

:root[data-theme="light"] .batch-textarea-wrapper textarea {
    color: #0f172a;
}

:root[data-theme="light"] .batch-textarea-wrapper textarea::placeholder {
    color: #94a3b8;
}

:root[data-theme="light"] .batch-actions-bar {
    border-top-color: rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .btn-action-text {
    color: rgba(15, 23, 42, 0.5);
}

:root[data-theme="light"] .btn-action-text:hover {
    color: rgba(15, 23, 42, 0.9);
}

:root[data-theme="light"] .batch-item-row {
    background: rgba(15, 23, 42, 0.01);
    border-color: rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .batch-item-row:hover {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .batch-item-title {
    color: #0f172a;
}

:root[data-theme="light"] .batch-item-author {
    color: #64748b;
}

:root[data-theme="light"] .batch-result-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .batch-summary h3 {
    color: #0f172a;
}

:root[data-theme="light"] .batch-progress-bar {
    background: rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .batch-progress-text {
    color: #64748b;
}

:root[data-theme="light"] .batch-dropdown-content {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .batch-dropdown-content button {
    color: #0f172a;
}

:root[data-theme="light"] .batch-dropdown-content button:hover {
    background: rgba(15, 23, 42, 0.05);
}




/* --- Nav Actions (Theme & Lang toggles) --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-nav-action {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid var(--card-border);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-nav-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.08);
}

/* --- Paste Clipboard Button style --- */
.btn-paste {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    transition: var(--transition);
}

.btn-paste:hover {
    color: var(--primary);
    transform: scale(1.15);
}

/* --- Slideshow Images Grid container --- */
.images-grid {
    padding: 0;
    background: transparent;
    border: none;
    max-height: none;
    overflow: visible;
}

/* --- TikTok-style Slideshow Photo Viewer --- */
.tiktok-slider-container {
    position: relative;
    width: 100%;
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .tiktok-slider-container {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.tiktok-slider-viewport {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    height: 320px; /* Compact height, perfect for results card */
}

/* Hide Scrollbar */
.tiktok-slider-viewport::-webkit-scrollbar {
    display: none;
}
.tiktok-slider-viewport {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.tiktok-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tiktok-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    pointer-events: none; /* Prevent drag conflicts on touch */
}

/* Top-Right Indicator Counter (Badge) */
.tiktok-slider-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .tiktok-slider-badge {
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Slide Navigation Arrows */
.tiktok-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0; /* Hidden by default on desktop, visible on hover */
}

.tiktok-slider-container:hover .tiktok-slider-arrow {
    opacity: 1;
}

/* Always visible on touch devices */
@media (max-width: 768px) {
    .tiktok-slider-arrow {
        opacity: 0.7;
    }
}

.tiktok-slider-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.tiktok-slider-arrow.prev {
    left: 12px;
}

.tiktok-slider-arrow.next {
    right: 12px;
}

.tiktok-slider-arrow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

:root[data-theme="light"] .tiktok-slider-arrow {
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .tiktok-slider-arrow:hover {
    background: rgba(255, 255, 255, 1);
}

/* Indicators (dots) container */
.tiktok-slider-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    pointer-events: auto;
}

.tiktok-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tiktok-indicator-dot.active {
    background: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 0 6px var(--primary);
}

:root[data-theme="light"] .tiktok-indicator-dot {
    background: rgba(15, 23, 42, 0.25);
}
:root[data-theme="light"] .tiktok-indicator-dot.active {
    background: var(--primary);
}

/* Download Slide Button styling */
.btn-download-slide-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    width: 100%;
}

.btn-download-slide {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
}

.btn-download-slide:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35);
}

:root[data-theme="light"] .btn-download-slide {
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.2);
}

/* --- Large Image Modal View (Dblclick/Double Tap) --- */
.large-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.large-image-content {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.large-image-content img {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.large-image-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
}

.large-image-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.large-image-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 15px 24px 30px 24px;
    box-sizing: border-box;
    z-index: 10000;
}

.large-image-counter {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
}

.large-image-download-btn {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.large-image-download-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    transform: scale(1.05);
}

/* --- Navigation Tabs --- */
.download-tabs {
    display: flex;
    background: rgba(8, 10, 18, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 1.25rem;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-btn svg {
    transition: transform 0.2s ease;
}

.tab-btn.active svg {
    transform: scale(1.05);
}

/* --- Batch Mode Input Group --- */
.batch-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-textarea-wrapper {
    background: rgba(8, 10, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 10px;
    transition: var(--transition);
}

.batch-textarea-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: var(--glow);
    background: rgba(8, 10, 18, 0.8);
}

.batch-textarea-wrapper textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
    padding: 6px;
    line-height: 1.5;
}

.batch-textarea-wrapper textarea::placeholder {
    color: #4b5563;
}

.batch-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    margin-top: 8px;
}

.btn-action-text {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 6px;
}

.btn-action-text:hover {
    color: var(--primary);
    background: rgba(0, 242, 254, 0.05);
}

.btn-action-text.btn-clear-text:hover {
    color: var(--secondary);
    background: rgba(254, 9, 121, 0.05);
}

.btn-fetch-batch {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #080b11;
    border: none;
    border-radius: 16px;
    padding: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-fetch-batch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 242, 254, 0.4);
    filter: brightness(1.15);
}

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

.btn-fetch-batch:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Batch Result Card --- */
.batch-result-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.batch-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
    margin-bottom: 12px;
    gap: 15px;
    flex-wrap: wrap;
}

.batch-summary {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-summary h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.batch-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.batch-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transition: width 0.3s ease;
}

.batch-progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.btn-download-all-batch {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #080b11;
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-download-all-batch:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
}

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

.batch-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.batch-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 10px;
    gap: 12px;
    transition: var(--transition);
}

.batch-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.batch-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.batch-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.batch-item-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.batch-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-item-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.batch-item-status {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.batch-item-status.pending { color: #9ca3af; }
.batch-item-status.processing { color: var(--primary); }
.batch-item-status.success { color: #10b981; }
.batch-item-status.failed { color: var(--secondary); }

.batch-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-batch-dl-small {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-batch-dl-small:hover {
    background: var(--primary);
    color: #080b11;
}

.btn-batch-dl-small.music {
    background: rgba(254, 9, 121, 0.1);
    color: var(--secondary);
    border-color: rgba(254, 9, 121, 0.15);
}

.btn-batch-dl-small.music:hover {
    background: var(--secondary);
    color: #f9fafb;
}

.btn-batch-dl-small.images {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.15);
}

.btn-batch-dl-small.images:hover {
    background: #a855f7;
    color: #f9fafb;
}

/* Spinner small in rows */
.spinner-tiny {
    width: 10px;
    height: 10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* --- Batch Video Quality Dropdown --- */
.batch-dropdown {
    position: relative;
    display: inline-block;
}

.batch-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 8px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 150px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    z-index: 100;
    overflow: hidden;
    animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.batch-dropdown-content.show {
    display: block;
}

.batch-dropdown-content button {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    outline: none;
    color: var(--text-color);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: block;
}

.batch-dropdown-content button:last-child {
    border-bottom: none;
}

.batch-dropdown-content button:hover {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
}

/* --- Batch Button Group --- */
.batch-btn-group {
    display: flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.15);
    transition: var(--transition);
}

.batch-btn-group .btn-batch-dl-small {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

.batch-btn-group .btn-batch-dl-small.btn-main-dl {
    border-right: 1px solid rgba(0, 242, 254, 0.2) !important;
    padding-right: 8px;
}

.batch-btn-group .btn-batch-dl-small.btn-arrow {
    padding: 6px 8px;
}

.batch-btn-group:hover {
    background: var(--primary);
}

.batch-btn-group:hover .btn-batch-dl-small {
    color: #080b11 !important;
}

.batch-btn-group:hover .btn-main-dl {
    border-right-color: rgba(8, 11, 17, 0.2) !important;
}

/* Live Photo Badge */
.live-photo-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

/* Navigation Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(17, 22, 39, 0.95);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    min-width: 150px;
    padding: 8px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
}

.dropdown-item {
    display: block;
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.dropdown-item:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

.dropdown-toggle::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin 0.2s ease;
    margin-bottom: 2px;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(-135deg);
    margin-bottom: -1px;
}

/* Light mode dropdown overrides */
:root[data-theme="light"] .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Language Dropdown Alignments */
.lang-dropdown .dropdown-menu {
    left: auto !important;
    right: 0 !important;
    transform: translateY(10px) !important;
}

.lang-dropdown:hover .dropdown-menu {
    transform: translateY(5px) !important;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

#btnLang {
    display: flex;
    align-items: center;
    gap: 6px;
}
