/* ============================================
   SnapSosmed - Main Stylesheet
   Modern Dark Theme with Gradient Accents
   ============================================ */

:root {
    --primary: #6c63ff;
    --primary-dark: #5a52d5;
    --primary-light: #8b85ff;
    --secondary: #ff6584;
    --accent: #43e97b;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card2: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b8a;
    --border: rgba(108, 99, 255, 0.2);
    --border-hover: rgba(108, 99, 255, 0.5);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 16px 48px rgba(108, 99, 255, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 101, 132, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(67, 233, 123, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.nav-logo .logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-light);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 2rem 60px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(108, 99, 255, 0.15);
    border: 1px solid rgba(108, 99, 255, 0.3);
    color: var(--primary-light);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 40px;
}

/* ============================================
   PLATFORM ICONS
   ============================================ */
.platforms {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.platform-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: default;
}

.platform-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.platform-chip .icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.platform-chip.youtube .icon { background: #ff0000; }
.platform-chip.tiktok .icon  { background: #010101; }
.platform-chip.instagram .icon { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.platform-chip.facebook .icon { background: #1877f2; }
.platform-chip.twitter .icon  { background: #000000; }

/* ============================================
   SEARCH / INPUT SECTION
   ============================================ */
.search-section {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.search-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 8px 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15), var(--shadow);
}

.search-box .search-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    padding: 10px 0;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Paste button */
.btn-paste {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-paste:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-section {
    display: none;
    text-align: center;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

.loading-section.active {
    display: block;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(108, 99, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.loading-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.step-dot {
    width: 8px;
    height: 8px;
    background: var(--border);
    border-radius: 50%;
    transition: var(--transition);
}

.step-dot.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* ============================================
   RESULT SECTION
   ============================================ */
.result-section {
    display: none;
    max-width: 780px;
    margin: 40px auto 0;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.result-section.active {
    display: block;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Video Info Header */
.video-info {
    display: flex;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.video-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 160px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card2);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: var(--transition);
}

.video-thumbnail:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 14px;
}

.video-meta {
    flex: 1;
    min-width: 0;
}

.video-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
}

.badge-youtube   { background: rgba(255,0,0,0.15); color: #ff4444; border: 1px solid rgba(255,0,0,0.2); }
.badge-tiktok    { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.badge-instagram { background: rgba(220,39,67,0.15); color: #e1306c; border: 1px solid rgba(220,39,67,0.2); }
.badge-facebook  { background: rgba(24,119,242,0.15); color: #1877f2; border: 1px solid rgba(24,119,242,0.2); }
.badge-twitter   { background: rgba(255,255,255,0.1); color: #1da1f2; border: 1px solid rgba(29,161,242,0.2); }

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.video-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.video-detail-item i {
    color: var(--primary-light);
}

/* Format Selection */
.format-section {
    padding: 24px;
}

.format-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.format-item {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.format-item.selected {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.12);
}

.format-item input[type="radio"] {
    display: none;
}

.format-info {
    flex: 1;
}

.format-quality {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.format-size {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.format-ext {
    background: rgba(108, 99, 255, 0.2);
    color: var(--primary-light);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.format-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.format-item.selected .format-check {
    border-color: var(--primary);
    background: var(--primary);
}

.format-item.selected .format-check::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
}

/* Download Button */
.download-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-download {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, var(--accent), #38d68a);
    color: #0a2a1a;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(67, 233, 123, 0.35);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-copy-link {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-copy-link:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ============================================
   ERROR SECTION
   ============================================ */
.error-section {
    display: none;
    max-width: 780px;
    margin: 30px auto 0;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.error-section.active {
    display: block;
}

.error-card {
    background: rgba(255, 68, 68, 0.08);
    border: 1px solid rgba(255, 68, 68, 0.25);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: slideUp 0.3s ease;
}

.error-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4444;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.error-content h4 {
    color: #ff6666;
    font-size: 1rem;
    margin-bottom: 6px;
}

.error-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 80px auto 0;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.feature-icon.purple { background: rgba(108, 99, 255, 0.15); }
.feature-icon.pink   { background: rgba(255, 101, 132, 0.15); }
.feature-icon.green  { background: rgba(67, 233, 123, 0.15); }
.feature-icon.blue   { background: rgba(64, 169, 255, 0.15); }
.feature-icon.orange { background: rgba(255, 165, 0, 0.15); }
.feature-icon.teal   { background: rgba(0, 206, 209, 0.15); }

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   HOW TO USE
   ============================================ */
.howto-section {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 80px auto 0;
    padding: 0 2rem;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.step-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    transition: var(--transition);
}

.step-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   SUPPORTED PLATFORMS TABLE
   ============================================ */
.platforms-section {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 80px auto 0;
    padding: 0 2rem;
}

.platforms-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.platforms-table th {
    background: var(--bg-card2);
    padding: 14px 20px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.platforms-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(108, 99, 255, 0.08);
    color: var(--text-secondary);
}

.platforms-table tr:last-child td {
    border-bottom: none;
}

.platforms-table tr:hover td {
    background: rgba(108, 99, 255, 0.04);
}

.check-yes { color: var(--accent); }
.check-no  { color: var(--text-muted); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    margin-top: 100px;
    border-top: 1px solid var(--border);
    padding: 40px 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-disclaimer {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-color: rgba(67, 233, 123, 0.4); }
.toast.error   { border-color: rgba(255, 68, 68, 0.4); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .nav-links { display: none; }
    .hero { padding: 50px 1rem 40px; }
    .hero h1 { font-size: 2rem; }
    .search-box { flex-wrap: wrap; padding: 12px; }
    .btn-primary { width: 100%; justify-content: center; }
    .video-info { flex-direction: column; }
    .video-thumbnail { width: 100%; height: 180px; }
    .format-grid { grid-template-columns: 1fr 1fr; }
    .download-actions { flex-direction: column; }
    .btn-download { min-width: unset; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-container { grid-template-columns: 1fr; }
    .toast { right: 15px; bottom: 15px; left: 15px; }
}

@media (max-width: 480px) {
    .format-grid { grid-template-columns: 1fr; }
    .platforms { gap: 8px; }
    .platform-chip { font-size: 0.78rem; padding: 6px 12px; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: rgba(108, 99, 255, 0.3);
    color: var(--text-primary);
}
