:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.6);
    --secondary: #a855f7;
    --accent: #06b6d4;
    --dark-bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--dark-bg);
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- BACKGROUND ANIMATIONS --- */
.cyber-grid {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    transform: perspective(500px) rotateX(60deg) scale(2);
    transform-origin: top center;
    animation: gridMove 20s linear infinite;
    z-index: -2;
    opacity: 0.2;
    pointer-events: none;
}

@keyframes gridMove {
    0% { background-position: center 0; }
    100% { background-position: center 40px; }
}

.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    opacity: 0.4;
    filter: blur(80px);
    animation: pulseGlow 5s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    100% { opacity: 0.5; transform: translateX(-50%) scale(1.1); }
}

/* --- TOP BAR (HUD) --- */
.top-hud {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(3, 7, 18, 0.5);
    backdrop-filter: blur(10px);
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -1px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span { color: var(--accent); }

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: blink 2s infinite;
}

@keyframes blink { 50% { opacity: 0.5; } }

/* --- MAIN LAYOUT --- */
.main-wrapper {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Header Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.badge-pro {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    display: inline-block;
    margin-bottom: 1rem;
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

/* Glitch Effect on Hover */
h1:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--accent);
}

@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}

.typing-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    height: 1.5rem;
    display: block;
}

/* --- WIDGET GRID --- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    margin-bottom: 2rem;
}

.mini-stat {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.3s;
}

.mini-stat:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- SEARCH CORE --- */
.core-interface {
    width: 100%;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 8px;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 10px;
    transition: all 0.3s ease;
}

.core-interface:focus-within {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    transform: scale(1.01);
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 25px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    width: 100%;
}

.url-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 35px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.action-btn:hover {
    background: var(--secondary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.action-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* --- PLATFORM ICONS --- */
.supported-platforms {
    margin-top: 1.5rem;
    display: flex;
    gap: 20px;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.supported-platforms:hover { opacity: 1; }

.pf-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pf-icon:hover { color: white; }

/* --- RESULT AREA --- */
#result-area {
    display: none;
    width: 100%;
    margin-top: 3rem;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Mobile first */
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.media-cover {
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
}

.media-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.result-card:hover .media-cover img {
    transform: scale(1.05);
}

.content-details {
    padding: 2rem;
    flex: 1;
}

.content-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.dl-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.dl-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* --- FOOTER MARQUEE --- */
.live-activity-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 0;
    z-index: 100;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

.activity-item {
    display: inline-flex;
    align-items: center;
    margin-right: 40px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.activity-item b { color: var(--accent); margin-right: 5px; }

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- UTILS --- */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.error-msg {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@media (min-width: 768px) {
    .result-card { flex-direction: row; }
    .media-cover { width: 300px; height: auto; }
    h1 { font-size: 4.5rem; }
}

@media (max-width: 600px) {
    .widget-grid { grid-template-columns: 1fr; }
    .brand span:last-child { display: none; }
}
