:root {
    --bg-color: #0f0f0f;
    --card-bg: rgba(30, 30, 30, 0.65);
    /* Transparent for glassmorphism */
    --primary: #bb86fc;
    --secondary: #03dac6;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    /* Midnight Mist: Deep Indigo + Dark Violet + Black base */
    background-image:
        radial-gradient(at 0% 0%, rgba(30, 30, 46, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(45, 0, 54, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(30, 30, 46, 0.4) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(45, 0, 54, 0.4) 0px, transparent 50%);
    background-size: 200% 200%;
    /* Enough for subtle movement */
    animation: gradient-animation 20s ease infinite;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px;
    border-radius: 50px;
    border: var(--glass-border);
    width: 60%;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.2);
}

input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 100%;
    padding: 0 15px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
}

/* Fix for browser autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--card-bg) inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

button#fetchBtn {
    background: var(--primary);
    border: none;
    color: #000;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

button#fetchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.4);
}

/* Main Content */
.hidden {
    display: none !important;
}

/* Video Player */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio - Default */
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
    transition: padding-top 0.3s ease;
}

/* Optimize for 9:16 (Portrait/Short Videos) */
.video-wrapper.portrait {
    padding-top: 177.78%;
    /* 9:16 Aspect Ratio */
    max-width: 100%;
    margin: 0 auto 20px auto;
}

@media (max-width: 768px) {

    /* Mobile: Full width portrait videos */
    .video-wrapper.portrait {
        padding-top: 177.78%;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        border-radius: 0;
        max-width: 100vw;
    }
}

@media (min-width: 769px) {

    /* Desktop: Center portrait videos with max-width */
    .video-wrapper.portrait {
        max-width: 400px;
        margin: 0 auto 20px auto;
        border-radius: 12px;
    }
}

/* Player Container */
.artplayer-app {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    z-index: 2;
    background: #000;
    width: 100% !important;
    height: 100% !important;
}

.video-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
    border-radius: 12px;
    border: var(--glass-border);
}

h2#videoTitle {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    grid-auto-rows: auto;
}

/* Portrait/Short Video Cards */
.file-card.portrait-card {
    grid-column: span 1;
}

.file-card.portrait-card .thumbnail-wrapper {
    padding-top: 177.78%;
    /* 9:16 Aspect Ratio */
}

@media (max-width: 600px) {

    /* Stack portrait cards differently on mobile */
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .file-card.portrait-card .thumbnail-wrapper {
        padding-top: 177.78%;
    }
}

.file-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: var(--glass-border);
}

.file-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.thumbnail-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Default */
    overflow: hidden;
    background: #000;
    transition: padding-top 0.3s ease;
}

/* Portrait thumbnails in grid */
.portrait-card .thumbnail-wrapper {
    padding-top: 177.78%;
    /* 9:16 Aspect Ratio */
}

.thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: var(--transition);
}

.file-card:hover .thumbnail-wrapper img {
    opacity: 1;
    transform: scale(1.05);
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.info-wrapper {
    padding: 15px;
}

.file-name {
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quality-badge,
.type-badge {
    background: var(--secondary);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

.type-badge {
    background: #FFD700;
    /* Gold for other types */
}

/* File Specific Styles */
.thumbnail-wrapper.file-thumb {
    background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon-large {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.6;
    transition: var(--transition);
}

.file-card:hover .file-icon-large {
    opacity: 1;
    transform: scale(1.1);
}

.download-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--primary);
    color: #000;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.file-card.type-file:hover {
    border-color: var(--secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    margin-top: 100px;
    opacity: 0.5;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px 20px;
        margin-bottom: 10px;
    }

    .logo {
        width: 100%;
        margin-bottom: 5px;
    }

    /* Edge-to-Edge Player on Mobile */
    .video-wrapper {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        border-radius: 0;
        box-shadow: none;
        background: #000;
    }

    /* Portrait videos stretch to screen on mobile */
    .video-wrapper.portrait {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        border-radius: 0;
    }

    .artplayer-app {
        border-radius: 0;
        width: 100% !important;
        height: 100% !important;
    }

    .video-info {
        border-radius: 0;
        margin: 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(30, 30, 30, 0.4);
    }

    /* Edge-to-Edge Thumbnails */
    .file-grid {
        padding: 0;
        grid-template-columns: 100%;
        gap: 0;
        display: block;
    }

    .file-card {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 0;
        width: 100%;
        background: transparent;
    }

    .thumbnail-wrapper {
        border-radius: 0;
        width: 100%;
    }

    .info-wrapper {
        padding: 12px 15px;
    }

    .file-card:hover {
        transform: none;
    }

    .search-box {
        width: 100%;
    }
}

/* FAQ Page Styles */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    background: linear-gradient(to right, #fff, #b0b0b0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.faq-item[open] {
    background: rgba(40, 40, 40, 0.8);
    border-color: var(--primary);
}

.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    list-style: none;
    /* Remove default triangle */
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary .icon {
    transition: transform 0.3s ease;
    color: var(--primary);
}

.faq-item[open] summary .icon {
    transform: rotate(180deg);
}

.faq-item .answer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-btn {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    border: var(--glass-border);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* ====== PAGE CONTENT ====== */
.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: var(--glass-border);
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .lead {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.content-section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 15px;
    border: var(--glass-border);
    padding: 40px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.content-section h2 {
    font-size: 1.5rem;
    margin: 30px 0 15px 0;
    color: var(--primary);
}

.content-section h3 {
    font-size: 1.2rem;
    margin: 20px 0 10px 0;
    color: var(--secondary);
}

.content-section p {
    margin-bottom: 15px;
    color: var(--text-main);
}

.content-section ul,
.content-section ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.content-section li {
    margin-bottom: 10px;
    color: var(--text-main);
}

.content-section a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.content-section a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* ====== NAVIGATION LINKS ====== */
.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
    padding: 8px 12px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* ====== CONTACT PAGE ====== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.contact-info h2 {
    margin-bottom: 20px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
}

.method {
    padding: 20px;
    background: rgba(187, 134, 252, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(187, 134, 252, 0.2);
}

.method i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.method h3 {
    margin: 10px 0 5px 0;
    color: var(--primary);
}

.method p {
    color: var(--text-muted);
    margin: 5px 0;
}

.method p.small {
    font-size: 0.85rem;
}

.contact-form {
    background: rgba(3, 218, 198, 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(3, 218, 198, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(3, 218, 198, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(187, 134, 252, 0.3);
}

.form-notice {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 15px;
}

.faq-preview {
    margin-top: 40px;
}

.qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.qa-item {
    padding: 20px;
    background: rgba(3, 218, 198, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(3, 218, 198, 0.2);
    transition: var(--transition);
}

.qa-item:hover {
    background: rgba(187, 134, 252, 0.1);
    border-color: rgba(187, 134, 252, 0.3);
}

.qa-item h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* ====== FOOTER ====== */
footer {
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 20px 30px;
    /* Increased padding and added horizontal padding */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1rem;
}

.footer-section h3 {
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-block;
    padding: 4px 0;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--secondary);
}

/* ====== SHORT VIDEO OPTIMIZATIONS ====== */

/* Portrait video container */
#playerSection.short-video-mode {
    padding: 0;
}

#playerSection.short-video-mode .video-wrapper {
    margin: 0;
}

/* Optimize file list for mobile short videos */
@media (max-width: 600px) {
    #fileListSection {
        margin-top: 20px;
    }

    .file-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .file-card {
        border-radius: 8px;
    }

    .file-card.portrait-card {
        grid-column: span 1;
    }

    .info-wrapper {
        padding: 10px;
    }

    .file-name {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }

    .file-meta {
        font-size: 0.7rem;
    }
}

/* Desktop layout for portrait videos */
@media (min-width: 769px) {

    /* Keep centered narrow player for portrait */
    .video-wrapper.portrait {
        max-width: 450px;
        margin-left: auto;
        margin-right: auto;
    }

    #playerSection {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .video-wrapper.portrait {
        max-width: 90vw;
        width: 100%;
    }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .nav-links {
        gap: 15px;
        font-size: 0.9rem;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 25px;
    }

    .footer-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        text-align: center;
        /* Centered all sections for symmetry */
    }

    /* Brand section full width and centered */
    .footer-section:first-child {
        grid-column: span 2;
        margin-bottom: 10px;
    }

    /* Support section full width and centered at bottom */
    .footer-section:nth-child(4) {
        grid-column: span 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 30px;
        margin-top: 10px;
    }

    .footer-section:nth-child(4) ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .footer-section h3,
    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .footer-section p {
        font-size: 0.9rem;
        margin-bottom: 10px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-section a {
        font-size: 0.9rem;
        padding: 5px 0;
    }

    .footer-bottom {
        font-size: 0.75rem;
        padding: 15px 0 0 0;
    }

    .qa-grid {
        grid-template-columns: 1fr;
    }
}