/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #070A12;
    background-image:
        radial-gradient(900px circle at 20% 0%, rgba(99, 102, 241, 0.18), transparent 55%),
        radial-gradient(700px circle at 95% 15%, rgba(34, 211, 238, 0.10), transparent 45%),
        radial-gradient(800px circle at 50% 100%, rgba(168, 85, 247, 0.10), transparent 55%);
    color: #e5e7eb;
    line-height: 1.6;
}

/* Header Styles */
.gradient-bg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(59, 130, 246, 0.95) 35%, rgba(34, 211, 238, 0.80) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(59, 130, 246, 0.95) 50%, rgba(168, 85, 247, 0.95) 100%);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(99, 102, 241, 0.25);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

/* Form Styles */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
}

.input-field:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.75);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.input-field::placeholder {
    color: rgba(229, 231, 235, 0.55);
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(14px);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

/* Layout: Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(7, 10, 18, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #f9fafb;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.brand-icon {
    font-size: 1.1rem;
    color: rgba(34, 211, 238, 0.95);
}

.brand-name {
    font-size: 1rem;
}

.topnav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: rgba(229, 231, 235, 0.75);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    color: #f9fafb;
    background: rgba(255, 255, 255, 0.06);
}

/* Layout: Hero */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(700px circle at 50% 20%, rgba(99, 102, 241, 0.22), transparent 55%),
        radial-gradient(700px circle at 80% 0%, rgba(34, 211, 238, 0.12), transparent 50%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(229, 231, 235, 0.85);
    font-weight: 700;
    font-size: 0.85rem;
}

.hero-title {
    margin: 1rem 0 0.5rem;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #f9fafb;
}

.hero-subtitle {
    margin: 0 auto;
    max-width: 52ch;
    color: rgba(229, 231, 235, 0.72);
    font-size: 1.05rem;
}

.hero-card {
    margin: 2rem auto 0;
    max-width: 820px;
    padding: 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(16px);
}

.hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.format-label {
    text-align: left;
    font-weight: 700;
    color: rgba(229, 231, 235, 0.75);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.hero-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.hero-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.15rem 0.75rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
}

.hero-input i {
    color: rgba(229, 231, 235, 0.55);
}

.hero-input .input-field {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0.9rem 0.2rem;
}

.hero-input .input-field:focus {
    border: none;
    box-shadow: none;
}

.hero-button {
    border-radius: 0.85rem;
    padding: 0.9rem 1.1rem;
    white-space: nowrap;
}

.helper-text {
    text-align: left;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: rgba(229, 231, 235, 0.55);
}

@media (max-width: 640px) {
    .topnav {
        display: none;
    }
    .hero-card {
        padding: 1rem;
    }
    .hero-search {
        grid-template-columns: 1fr;
    }
    .hero-button {
        width: 100%;
    }
}

/* Sections */
.section {
    margin-top: 2.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.7rem;
    margin: 0;
    color: #f9fafb;
    letter-spacing: -0.01em;
}

.section-subtitle {
    margin: 0.25rem auto 0;
    color: rgba(229, 231, 235, 0.65);
    max-width: 60ch;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

.glass-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 1rem;
    padding: 1.2rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.22);
    color: rgba(34, 211, 238, 0.95);
    margin-bottom: 0.9rem;
}

.feature-title {
    margin: 0;
    color: #f9fafb;
    font-size: 1.05rem;
}

.feature-text {
    margin: 0.45rem 0 0;
    color: rgba(229, 231, 235, 0.68);
    font-size: 0.95rem;
}

/* Result */
.result-shell {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
}

.result-head {
    padding: 1.2rem 1.2rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.result-title {
    margin: 0;
    color: #f9fafb;
    font-size: 1.35rem;
}

.result-meta {
    margin-top: 0.3rem;
    color: rgba(229, 231, 235, 0.70);
    font-weight: 600;
}

.result-body {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
    padding: 1.2rem;
}

.result-preview {
    border-radius: 0.9rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.35);
}

.result-video {
    width: 100%;
    height: 100%;
    display: block;
    max-height: 360px;
    object-fit: cover;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.btn-ghost {
    background: transparent;
    color: rgba(229, 231, 235, 0.80);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .result-body {
        grid-template-columns: 1fr;
    }
}

/* Format Toggle */
.format-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.format-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    color: rgba(229, 231, 235, 0.72);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.format-option:has(input:checked) {
    background: rgba(255, 255, 255, 0.12);
    color: #f9fafb;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
}

/* Small screens */
@media (max-width: 480px) {
    .format-toggle {
        width: 100%;
        justify-content: space-between;
    }
    .format-option {
        flex: 1;
    }
}

/* Video Preview */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 177.78%; /* 16:9 Aspect Ratio */
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    overflow: hidden;
}

.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(3, 6, 18, 0.72);
    z-index: 50;
    align-items: center;
    justify-content: center;
}

.loading-spinner.active {
    display: flex;
}

.loading-spinner > div {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 1rem;
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
}

.loading-spinner p {
    color: rgba(229, 231, 235, 0.90) !important;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: rgba(99, 102, 241, 0.95);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Responsive Design */
@media (min-width: 768px) {
    .md\:flex-row {
        flex-direction: row;
    }
    
    .md\:items-start {
        align-items: flex-start;
    }
    
    .md\:text-left {
        text-align: left;
    }
    
    .md\:mb-0 {
        margin-bottom: 0;
    }
    
    .md\:mr-6 {
        margin-right: 1.5rem;
    }
    
    .md\:w-1\/2 {
        width: 50%;
    }
    
    .md\:w-1\/3 {
        width: 33.333333%;
    }
    
    .md\:w-2\/3 {
        width: 66.666667%;
    }
    
    .md\:max-w-md {
        max-width: 28rem;
    }
}

/* Grid Layout */
.grid {
    display: grid;
}

.gap-6 {
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Error Message */
.error-message {
    background-color: rgba(239, 68, 68, 0.10);
    border-left: 4px solid rgba(239, 68, 68, 0.90);
    color: rgba(254, 226, 226, 0.95);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.error-message i {
    margin-right: 0.5rem;
}

/* Footer */
footer {
    background-color: rgba(7, 10, 18, 0.70);
    color: rgba(229, 231, 235, 0.90);
    padding: 1.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.footer-left {
    color: rgba(229, 231, 235, 0.85);
    font-weight: 700;
}

.footer-right {
    color: rgba(229, 231, 235, 0.60);
    text-align: right;
    max-width: 70ch;
}

@media (max-width: 720px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-right {
        text-align: left;
    }
}

footer p {
    margin: 0;
}

footer .text-gray-400 {
    color: #9ca3af;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
