﻿/* File: static/css/main.css
   Dành cho dự án Flask chạy Tailwind qua CDN
*/

/* 1. KHAI BÁO BIẾN MÀU (Đồng bộ với UI DouyinSave/VideoSnap) */
:root {
    --primary: #0D6EFD;
    --primary-hover: #0a58ca;
    --surface: #F8F9FA;
    --on-surface: #1A1C1E;
    --on-surface-variant: #424655;
    --secondary: #28dfb5;
    --font-main: 'Manrope', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

/* 2. CẤU HÌNH CƠ BẢN */
body {
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    scroll-behavior: smooth;
}

/* 3. CÁC THÀNH PHẦN UI TÙY CHỈNH (Custom Components) */

/* Card giống trong file detail.html */
.ui-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ui-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Nút bấm Download đặc trưng */
.btn-main {
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s transform;
    border: none;
    cursor: pointer;
}

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

.btn-main:active {
    transform: scale(0.95);
}

#download-btn {
    color: #ffffff !important;
    text-decoration: none;
    min-height: 48px;
}

#download-btn .download-btn-label {
    display: inline;
    color: inherit;
}

/* Thanh Search chính ở trang chủ */
.search-container {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 0.5rem;
    border: 1px solid #f1f5f9;
}

.search-input-custom {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-family: var(--font-secondary);
    font-size: 1rem;
    background: transparent;
}

/* 4. TIỆN ÍCH CHO ICON & SCROLLBAR */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Thanh cuộn hiện đại */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 5. HIỆU ỨNG PRELOADER */
#preloader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--surface);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
