:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --danger: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
}

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

.search-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 0.75rem;
    display: flex;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    border-color: var(--primary);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    width: 100%;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    white-space: nowrap;
}

button:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: default;
}

#result-container {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

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

.media-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 2.5rem;
    margin-top: 1rem;
}

.media-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .media-header { flex-direction: column; }
}

.thumbnail-wrap {
    flex-shrink: 0;
    width: 240px;
    position: relative;
}

.thumbnail-wrap img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
}

.media-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media-info h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.uploader {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.description {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.format-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.format-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.format-details h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.format-details span {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
}

.download-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: white;
    background: var(--primary);
}

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

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

.badge-video { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.badge-audio { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-image { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.sections {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    display: inline-block;
}

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

.error-card {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
}
