/* Import Modern Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* CSS Variables for Theming */
:root {
    --primary-teal: rgb(0, 179, 179);
    --primary-teal-dark: rgb(0, 128, 128);
    --primary-teal-light: rgb(0, 199, 199);

    /* Dark Theme (Default) */
    --bg-primary: #0a0f1e;
    --bg-secondary: rgba(255, 255, 255, 0.03);
    --bg-tertiary: rgba(255, 255, 255, 0.05);
    --bg-gradient-1: rgba(0, 179, 179, 0.15);
    --bg-gradient-2: rgba(0, 128, 128, 0.1);
    --bg-gradient-3: rgba(10, 15, 30, 1);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-tertiary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.5);

    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.2);

    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-teal: rgba(0, 179, 179, 0.2);

    --input-bg: rgba(255, 255, 255, 0.05);
    --input-bg-hover: rgba(255, 255, 255, 0.08);
    --input-bg-focus: rgba(255, 255, 255, 0.1);

    --card-bg: rgba(255, 255, 255, 0.03);
    --card-bg-hover: rgba(0, 179, 179, 0.05);

    --header-gradient-start: rgba(0, 179, 179, 0.1);
    --header-gradient-end: rgba(0, 128, 128, 0.05);

    --overlay-gradient: linear-gradient(135deg, transparent 0%, rgba(0, 179, 179, 0.03) 50%, transparent 100%);
}

/* Light Theme */
html.light-theme body {
    --bg-primary: #f5f7fa;
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --bg-tertiary: rgba(255, 255, 255, 0.95);
    --bg-gradient-1: rgba(0, 179, 179, 0.05);
    --bg-gradient-2: rgba(0, 128, 128, 0.03);
    --bg-gradient-3: rgba(245, 247, 250, 1);

    --text-primary: #1a1a1a;
    --text-secondary: rgba(0, 0, 0, 0.8);
    --text-tertiary: rgba(0, 0, 0, 0.6);
    --text-muted: rgba(0, 0, 0, 0.5);

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.15);

    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-teal: rgba(0, 179, 179, 0.15);

    --input-bg: rgba(0, 0, 0, 0.03);
    --input-bg-hover: rgba(0, 0, 0, 0.05);
    --input-bg-focus: rgba(0, 0, 0, 0.08);

    --card-bg: rgba(255, 255, 255, 0.9);
    --card-bg-hover: rgba(0, 179, 179, 0.05);

    --header-gradient-start: rgba(0, 179, 179, 0.08);
    --header-gradient-end: rgba(0, 128, 128, 0.04);

    --overlay-gradient: linear-gradient(135deg, transparent 0%, rgba(0, 179, 179, 0.02) 50%, transparent 100%);
}

/* Basic Reset & Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image:
        radial-gradient(at 20% 30%, var(--bg-gradient-1) 0px, transparent 50%),
        radial-gradient(at 80% 70%, var(--bg-gradient-2) 0px, transparent 50%),
        radial-gradient(at 50% 50%, var(--bg-gradient-3) 0px, transparent 50%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    max-width: 1200px;
    margin: auto;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-gradient);
    pointer-events: none;
    z-index: 0;
}

/* Container for main content */
main {
    flex: 1;
    margin: 20px auto;
    padding: 50px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid var(--border-primary);
    box-shadow:
        0 8px 32px var(--shadow-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-teal) 50%,
        transparent 100%);
    border-radius: 24px 24px 0 0;
}

main:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 48px var(--shadow-teal),
        0 0 0 1px rgba(0, 179, 179, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Header Styling */
header {
    text-align: center;
    padding: 40px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 24px;
    margin-bottom: 40px;
    position: relative;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 8px 32px var(--shadow-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-teal) 50%,
        transparent 100%);
    border-radius: 24px 24px 0 0;
}

header .site-title {
    font-size: 3.5em;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--primary-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

header .site-title:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 12px rgba(0, 179, 179, 0.4));
    letter-spacing: 0.01em;
}

header .site-title:focus {
    outline: 2px solid var(--primary-teal);
    outline-offset: 6px;
    border-radius: 12px;
}

header .site-logo {
    width: 64px;
    height: 64px;
    color: var(--primary-teal);
    filter: drop-shadow(0 4px 12px rgba(0, 179, 179, 0.4));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

header .site-logo:hover {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 8px 20px rgba(0, 179, 179, 0.6));
}

html.light-theme body header .site-logo {
    filter: drop-shadow(0 3px 8px rgba(0, 128, 128, 0.2));
}

html.light-theme body header .site-logo:hover {
    filter: drop-shadow(0 6px 14px rgba(0, 128, 128, 0.3));
}

header p {
    font-size: 1.3em;
    color: var(--text-secondary);
    font-weight: 400;
    position: relative;
    z-index: 1;
    letter-spacing: 0.01em;
}

/* Platform Selection Section */
.platform-selection {
    margin-top: 60px;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-primary);
    position: relative;
}

.platform-selection::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-teal) 50%,
        transparent 100%);
}

/* Platform Navigation */
.platform-nav {
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.platform-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    width: 110px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.platform-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 179, 179, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.platform-btn:hover::before {
    opacity: 1;
}

.platform-btn:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--primary-teal);
    box-shadow: 0 8px 24px rgba(0, 179, 179, 0.3);
    color: var(--text-primary);
}

.platform-btn.active {
    border-color: var(--primary-teal);
    background: linear-gradient(135deg, rgba(0, 179, 179, 0.15) 0%, rgba(0, 128, 128, 0.1) 100%);
    box-shadow: 0 0 0 2px rgba(0, 179, 179, 0.2), 0 4px 16px rgba(0, 179, 179, 0.2);
    color: var(--primary-teal);
}

.platform-btn.active::before {
    opacity: 1;
}

.platform-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-btn:hover .platform-icon {
    transform: scale(1.15) rotate(5deg);
}

.platform-btn.active .platform-icon {
    transform: scale(1.1);
}

.platform-icon svg {
    width: 100%;
    height: 100%;
}

.platform-name {
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

/* Platform-specific icon colors */
.youtube-icon {
    color: #FF0000;
}

.facebook-icon {
    color: #1877F2;
}

.instagram-icon {
    color: #E4405F;
}

.vimeo-icon {
    color: #1AB7EA;
}

.tiktok-icon {
    color: #000000;
}

.twitter-icon {
    color: #1DA1F2;
}

/* Platform button hover effects with brand colors */
.platform-btn[data-platform="youtube"]:hover {
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.3);
}

.platform-btn[data-platform="facebook"]:hover {
    box-shadow: 0 8px 24px rgba(24, 119, 242, 0.3);
}

.platform-btn[data-platform="instagram"]:hover {
    box-shadow: 0 8px 24px rgba(228, 64, 95, 0.3);
}

.platform-btn[data-platform="vimeo"]:hover {
    box-shadow: 0 8px 24px rgba(26, 183, 234, 0.3);
}

.platform-btn[data-platform="tiktok"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.platform-btn[data-platform="twitter"]:hover {
    box-shadow: 0 8px 24px rgba(29, 161, 242, 0.3);
}

/* Responsive platform navigation */
@media (max-width: 768px) {
    .platform-buttons {
        gap: 10px;
    }

    .platform-btn {
        padding: 12px 16px;
        width: 90px;
    }

    .platform-icon {
        width: 28px;
        height: 28px;
    }

    .platform-name {
        font-size: 0.75em;
    }

}

@media (max-width: 480px) {
    .platform-buttons {
        gap: 8px;
    }

    .platform-btn {
        padding: 10px 12px;
        width: 75px;
        gap: 6px;
    }

    .platform-icon {
        width: 24px;
        height: 24px;
    }

    .platform-name {
        font-size: 0.7em;
    }
}

/* Main Page Heading */
.download-form h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.02em;
}

/* Section Headings */
h2 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.02em;
}

/* Form Styling */
.download-form {
    padding: 30px 0;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85em;
}

.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--input-bg);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.form-group input[type="url"] {
    border-width: 2px;
    border-color: var(--border-secondary);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        0 2px 8px var(--shadow-color);
    cursor: text;
    caret-color: var(--primary-teal);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

html.light-theme body .form-group input[type="url"] {
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-group input[type="url"]::placeholder {
    color: var(--text-muted);
    opacity: 0.9;
    text-transform: none;
}

.form-group input[type="url"]:hover,
.form-group select:hover {
    border-color: rgba(0, 179, 179, 0.4);
    background: var(--input-bg-hover);
}

.form-group input[type="url"]:focus,
.form-group select:focus {
    border-color: var(--primary-teal);
    background: var(--input-bg-focus);
    box-shadow:
        0 0 0 3px rgba(0, 179, 179, 0.2),
        0 8px 16px rgba(0, 179, 179, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.form-group select {
    cursor: pointer;
}

html.light-theme body .form-group select option {
    background: #ffffff;
    color: #1a1a1a;
}

html:not(.light-theme) body .form-group select option {
    background: #1a1a2e;
    color: #ffffff;
}

/* New Privacy Options Styling */
.privacy-options-container > label {
    text-align: center;
    margin-bottom: 20px;
}

.privacy-buttons {
    display: flex;
    gap: 20px; /* Space between the two buttons */
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.privacy-button {
    flex: 1;
    min-width: 280px;
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.privacy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 179, 179, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.privacy-button:hover::before {
    opacity: 1;
}

.privacy-button:hover {
    border-color: rgba(0, 179, 179, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 179, 179, 0.2);
}

.privacy-button input[type="radio"] {
    display: none; /* Hide the actual radio button */
}

/* Style for when a privacy option is selected */
.privacy-button input[type="radio"]:checked ~ h3 {
    color: var(--primary-teal);
}

.privacy-button input[type="radio"]:checked ~ p {
    color: var(--text-secondary);
}

.privacy-button h3 {
    font-size: 1.4em;
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.privacy-button h3 > span {
    font-size: 2.8em;
    display: block;
    filter: grayscale(0.2);
    transition: all 0.3s ease;
    line-height: 1;
}

.privacy-button:hover h3 > span {
    filter: grayscale(0);
    transform: scale(1.1);
}

.privacy-button p {
    font-size: 0.9em;
    color: var(--text-tertiary);
    margin-bottom: 0;
    font-weight: normal;
    line-height: 1.6;
}

.privacy-button:has(input[type="radio"]:checked) {
    border-color: var(--primary-teal);
    background: linear-gradient(135deg,
        rgba(0, 179, 179, 0.15) 0%,
        rgba(0, 128, 128, 0.1) 100%);
    box-shadow:
        0 0 0 2px rgba(0, 179, 179, 0.3),
        0 8px 32px rgba(0, 179, 179, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(1.03);
}

.privacy-button:has(input[type="radio"]:checked)::before {
    opacity: 1;
}

/* Media query for smaller screens */
@media (max-width: 600px) {
    .privacy-buttons {
        gap: 12px;
    }

    .privacy-button {
        min-width: unset;
        padding: 20px 15px;
        flex: 1;
    }

    .privacy-button h3 {
        font-size: 1.1em;
        margin-top: 10px;
        margin-bottom: 8px;
    }

    .privacy-button h3 > span {
        font-size: 2em;
    }

    /* Keep description text visible on mobile */
    .privacy-button p {
        font-size: 0.85em;
        line-height: 1.5;
        margin-top: 10px;
    }
}

/* Download Button */
.btn-download {
    display: block;
    width: 100%;
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow:
        0 8px 24px rgba(0, 179, 179, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    transition: left 0.6s ease;
}

.btn-download::after {
    content: '→';
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    font-size: 1.5em;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-download:hover::before {
    left: 100%;
}

.btn-download:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
}

.btn-download:hover {
    background: linear-gradient(135deg, var(--primary-teal-light) 0%, var(--primary-teal) 100%);
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        0 16px 48px rgba(0, 179, 179, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.15em;
}

.btn-download:active {
    transform: translateY(-2px) scale(0.99);
    box-shadow:
        0 8px 24px rgba(0, 179, 179, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Features Section */
.platform-insights {
    margin-top: 60px;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-primary);
    position: relative;
}

.platform-insights::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-teal) 50%,
        transparent 100%);
}

.platform-insights p {
    max-width: 900px;
    margin: 0 auto 14px;
    color: var(--text-secondary);
    font-size: 1.05em;
    line-height: 1.8;
}

.platform-insights p:last-child {
    margin-bottom: 0;
}

.features {
    margin-top: 60px;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-primary);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-teal) 50%,
        transparent 100%);
}

.features ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding-top: 20px;
}

.features li {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 28px;
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--primary-teal);
    border-radius: 16px;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.features li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg,
        var(--primary-teal) 0%,
        var(--primary-teal-dark) 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.features li:hover::before {
    transform: scaleY(1);
}

.features li:hover {
    transform: translateX(8px);
    box-shadow:
        -4px 0 0 rgba(0, 179, 179, 0.5),
        0 8px 32px var(--shadow-teal);
    border-left-color: transparent;
    background: var(--card-bg-hover);
}

.features li strong {
    color: var(--primary-teal);
    font-size: 1.2em;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Footer Styling */
footer {
    padding: 40px 20px;
    margin-top: 60px; 
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 179, 179, 0.5) 50%,
        transparent 100%);
}

footer a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #dc3545;
}

html.light-theme footer a {
    color: #0066cc;
}

html.light-theme footer a:hover {
    color: #dc3545;
}

html:not(.light-theme) footer a {
    color: #e2e8f0;
}

html:not(.light-theme) footer a:hover {
    color: #dc3545;
}

/* Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header,
    main,
    footer {
        padding-left: 25px;
        padding-right: 25px;
        width: 100%;
        box-sizing: border-box;
    }

    header {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    header .site-title {
        font-size: 2em;
        gap: 12px;
    }

    header .site-logo {
        width: 40px;
        height: 40px;
    }

    header p {
        font-size: 1em;
    }

    .download-form h1 {
        font-size: 2em;
    }

    main {
        margin: 15px auto;
        padding-top: 30px;
        padding-bottom: 25px;
    }

    h2 {
        font-size: 2em;
    }

    .form-group label {
        font-size: 0.85em;
    }

    .form-group input[type="url"],
    .form-group select {
        padding: 14px 18px;
    }

    .btn-download {
        padding: 18px 24px;
        font-size: 1.1em;
    }

    .features ul {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .features li:hover {
        transform: translateX(4px);
    }
}

/* Inline form groups for resolution and output format */
.form-group-inline-pair {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group-inline-pair .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Media query for smaller screens to stack inline form groups */
@media (max-width: 600px) {
    .form-group-inline-pair .form-group {
        display: block; /* Stack vertically */
        width: 100%;
        margin-right: 0;
        margin-bottom: 25px; /* Re-add margin when stacked */
    }
    .form-group-inline-pair .form-group:last-child {
        margin-bottom: 0; /* No margin after last item when stacked */
    }
}

h3.privacy-mode-title {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--shadow-color);
    z-index: 2;
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px var(--shadow-teal);
    border-color: var(--primary-teal);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.98);
}

.theme-toggle .theme-icon {
    transition: transform 0.4s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg) scale(1.1);
}

html.light-theme body .theme-toggle .theme-icon::before {
    content: '\1F319';
}

html:not(.light-theme) body .theme-toggle .theme-icon::before {
    content: '\2600\FE0F';
}

.theme-icon::before {
    display: block;
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
}

/* Modern Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth page load animations */
header {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

main {
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.features li {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.features li:nth-child(1) { animation-delay: 0.1s; }
.features li:nth-child(2) { animation-delay: 0.2s; }
.features li:nth-child(3) { animation-delay: 0.3s; }
.features li:nth-child(4) { animation-delay: 0.4s; }

/* Privacy button icon animations */
.privacy-button:has(input[type="radio"]:checked) h3 > span {
    filter: grayscale(0);
    animation: pulse 2s ease-in-out infinite;
}

/* Add smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: rgba(0, 179, 179, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(0, 179, 179, 0.3);
    color: #ffffff;
}

/* Custom Scrollbar for Modern Look */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(0, 179, 179, 0.5) 0%,
        rgba(0, 128, 128, 0.5) 100%);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(0, 179, 179, 0.7) 0%,
        rgba(0, 128, 128, 0.7) 100%);
}

/* Thumbnail Gallery Grid */
.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 0;
}

.thumbnail-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--shadow-color);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.thumbnail-card[hidden] {
    display: none !important;
}

.thumbnail-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px var(--shadow-teal);
    border-color: var(--primary-teal);
}

.thumbnail-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumbnail-card:hover .thumbnail-image-wrapper img {
    transform: scale(1.05);
}

.thumbnail-info {
    padding: 20px;
}

.thumbnail-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.meta-item {
    text-align: center;
    padding: 12px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.meta-item:hover {
    background: var(--input-bg-hover);
    border-color: rgba(0, 179, 179, 0.3);
}

.meta-item-label {
    display: block;
    font-size: 0.65em;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.meta-item-value {
    display: block;
    font-size: 0.85em;
    color: var(--primary-teal);
    font-weight: 700;
}

.thumbnail-download-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 16px rgba(0, 179, 179, 0.4);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    text-align: center;
}

.thumbnail-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.thumbnail-download-btn::after {
    content: '⬇';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumbnail-download-btn:hover::before {
    left: 100%;
}

.thumbnail-download-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateY(2px);
}

.thumbnail-download-btn:hover {
    background: linear-gradient(135deg, var(--primary-teal-light) 0%, var(--primary-teal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 179, 179, 0.6);
    letter-spacing: 0.1em;
    padding-right: 50px;
}

.thumbnail-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 179, 179, 0.4);
}

/* Loading spinner for thumbnail cards */
.thumbnail-card.loading .thumbnail-image-wrapper::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-teal);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive grid for thumbnails */
@media (max-width: 768px) {
    .thumbnail-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .thumbnail-meta {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .meta-item {
        padding: 10px;
    }

    .meta-item-label {
        font-size: 0.7em;
    }

    .meta-item-value {
        font-size: 0.9em;
    }
}

/* Card moved animation */
@keyframes cardMoved {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 179, 179, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(0, 179, 179, 0.4);
    }
    100% {
        box-shadow: 0 4px 16px var(--shadow-color);
    }
}

.thumbnail-card.moved {
    animation: cardMoved 1s ease-out;
}

/* Add focus styles for better accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid rgb(0, 179, 179);
    outline-offset: 2px;
}

/* Form Loading State */
form.is-loading {
    position: relative;
    pointer-events: none; /* Disable interaction during loading */
}

/* Semi-transparent overlay */
form.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9;
}

/* Loading spinner */
form.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 150, 136, 0.2);
    border-top-color: var(--primary-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* FAQ Section Styles */
.faq-section {
    margin-top: 3rem;
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: var(--text-primary, #1a1a1a);
}

.faq-grid {
    display: grid;
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: #fafbfc;
    border: 2px solid #e1e4e8;
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

html:not(.light-theme) .faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.faq-item:hover {
    border-color: #93a5b1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

html:not(.light-theme) .faq-item:hover {
    border-color: rgba(0, 179, 179, 0.4);
    box-shadow: 0 4px 12px rgba(0, 179, 179, 0.2);
}

.faq-item[open] {
    border-color: #7b8a96;
    background: #f6f8fa;
}

html:not(.light-theme) .faq-item[open] {
    border-color: rgba(0, 179, 179, 0.5);
    background: rgba(0, 179, 179, 0.05);
}

.faq-question {
    padding: 1.5rem 1.75rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    background: linear-gradient(135deg, #9ba7b3 0%, #b4bec9 100%);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(155,167,179,0.2);
    display:inline-block;
}

html.light-theme .faq-icon {
    background: linear-gradient(135deg, #c5cdd6 0%, #d9dfe5 100%);
    box-shadow: 0 2px 6px rgba(197,205,214,0.25);
}

html:not(.light-theme) .faq-icon {
    background: linear-gradient(135deg, #5a6875 0%, #6f7c8a 100%);
    box-shadow: 0 2px 6px rgba(90,104,117,0.3);
}

.faq-text {
    font-weight: 600;
    font-size: 1.25rem;
    color: #2c3e50;
    line-height: 48px;
    flex: 1;
    margin-left:  10px;
}

html:not(.light-theme) .faq-text {
    color: rgba(255, 255, 255, 0.9);
}

.faq-toggle {
    font-size: 0.9rem;
    color: #6c7a89;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    line-height: 48px;
    float: right;
}

html:not(.light-theme) .faq-toggle {
    color: rgba(255, 255, 255, 0.6);
}

.faq-item[open] .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.75rem 1.5rem 1.75rem;
    margin-top: -10px;
    animation: fadeIn 0.3s ease;
    clear: both;
}

.faq-answer p,
.faq-answer ul {
    margin: 0 0 0.75rem 0;
    color: #555;
    line-height: 1.7;
    font-size: 1rem;
}

.faq-answer p:last-child,
.faq-answer ul:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    padding-left: 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.25rem;
    color: #555;
}

html:not(.light-theme) .faq-answer p,
html:not(.light-theme) .faq-answer ul,
html:not(.light-theme) .faq-answer li {
    color: rgba(255, 255, 255, 0.7);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .faq-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .faq-question {
        padding: 1.25rem;
    }

    .faq-icon {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.5rem;
    }

    .faq-text {
        font-size: 1.1rem;
        line-height: 40px;
    }

    .faq-toggle {
        line-height: 40px;
    }

    .faq-answer {
        padding: 0 1.25rem 1.25rem 1.25rem;
    }

    .faq-answer p,
    .faq-answer ul {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .faq-answer li {
        font-size: 0.95rem;
    }
}
