/* ============================================================
   css/style.css - ПОЛНЫЕ СТИЛИ САЙТА FRAMEGRAB
   ============================================================ */

/* ====== БАЗА ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Roboto, system-ui, sans-serif; background: #f5f7fa; color: #1a1a2e; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ====== ШАПКА ====== */
.header { text-align: center; padding: 30px 0 15px; }
.logo {
    display: inline-flex; align-items: center; gap: 16px;
    text-decoration: none; font-size: 28px; font-weight: 700;
    padding: 12px 24px; background: white; border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: transform 0.2s;
    color: #1a1a2e;
}
.logo:hover { transform: scale(1.02); }
.logo-icon { width: 48px; height: 48px; background: #2196F3; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 24px; }
.logo-text span { color: #2196F3; }
.subtitle {
    text-align: center; color: #666; font-size: 18px; margin: 16px 0 30px;
    padding: 16px 24px; background: white; border-radius: 16px;
    border-left: 4px solid #2196F3; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ====== ПЛАТФОРМЫ ====== */
.platform-switcher {
    display: flex; gap: 12px; justify-content: center; margin-bottom: 30px; flex-wrap: wrap;
}
.btn-platform {
    padding: 12px 28px; border: 2px solid #e0e0e0; border-radius: 12px;
    cursor: pointer; background: white; color: #666; font-weight: 600;
    transition: all 0.3s; font-size: 15px; display: flex; align-items: center; gap: 10px;
    font-family: inherit;
}
.btn-platform:hover { border-color: #2196F3; color: #2196F3; transform: translateY(-2px); }
.btn-platform .platform-icon { width: 24px; height: 24px; object-fit: contain; }
.btn-platform.active {
    border-color: var(--platform-color, #2196F3);
    color: var(--platform-color, #2196F3);
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* ====== КАРТОЧКИ ====== */
.card { background: white; padding: 32px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group input {
    width: 100%; padding: 16px 20px; border: 2px solid #e0e0e0;
    border-radius: 12px; font-size: 16px; box-sizing: border-box;
    font-family: inherit; transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus { outline: none; border-color: #2196F3; box-shadow: 0 0 0 4px rgba(33,150,243,0.1); }
.btn-primary {
    width: 100%; padding: 16px 32px; background: #2196F3; color: white;
    border: none; border-radius: 12px; cursor: pointer;
    font-size: 18px; font-weight: 600; transition: all 0.3s; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:hover { background: #1976D2; transform: translateY(-2px); box-shadow: 0 6px 25px rgba(33,150,243,0.35); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ====== СЕКЦИИ ====== */
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-title { font-size: 24px; color: #1a1a2e; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title i { color: #2196F3; }
.stats-bar { display: flex; gap: 20px; font-size: 14px; color: #666; }
.stats-bar span { display: flex; align-items: center; gap: 6px; background: #f0f2f5; padding: 4px 14px; border-radius: 20px; }
.stats-bar span i { font-size: 14px; color: #2196F3; }

/* ====== ГАЛЕРЕЯ ПОСЛЕДНИХ ПРЕВЬЮ ====== */
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.recent-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}
.recent-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.recent-card-link { display: block; text-decoration: none; color: #1a1a2e; }
.recent-card-link .image-wrap {
    position: relative;
    background: #f5f7fa;
    padding: 12px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recent-card-link .image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.recent-card-link .platform-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}
.recent-card:hover .platform-badge { transform: scale(1.08); }
.recent-card-link .platform-badge img { width: 20px; height: 20px; display: block; }
.recent-card-link .card-info { padding: 12px 14px 4px 14px; }
.recent-card-link .card-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-card-link .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}
.recent-card-link .card-date { font-size: 11px; color: #aaa; margin-top: 4px; }
.recent-card-actions { padding: 0 14px 14px 14px; }

.btn-favorite-small {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 13px;
    color: #999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
}
.btn-favorite-small:hover { background: #FBBF24; color: white; border-color: #FBBF24; }
.btn-favorite-small.active { background: #FBBF24; color: white; border-color: #FBBF24; }
.btn-favorite-small i { font-size: 12px; }

.view-all-btn {
    display: inline-block; padding: 12px 32px; background: #2196F3; color: white;
    border-radius: 12px; text-decoration: none; font-weight: 600;
    transition: all 0.3s; border: none; cursor: pointer; font-family: inherit; font-size: 15px;
}
.view-all-btn:hover { background: #1976D2; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(33,150,243,0.3); }

/* ====== АНИМАЦИИ ====== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.recent-card:nth-child(1) { animation-delay: 0.05s; }
.recent-card:nth-child(2) { animation-delay: 0.10s; }
.recent-card:nth-child(3) { animation-delay: 0.15s; }
.recent-card:nth-child(4) { animation-delay: 0.20s; }
.recent-card:nth-child(5) { animation-delay: 0.25s; }
.recent-card:nth-child(6) { animation-delay: 0.30s; }
.recent-card:nth-child(7) { animation-delay: 0.35s; }
.recent-card:nth-child(8) { animation-delay: 0.40s; }
.recent-card:nth-child(9) { animation-delay: 0.45s; }
.recent-card:nth-child(10) { animation-delay: 0.50s; }
.recent-card:nth-child(11) { animation-delay: 0.55s; }
.recent-card:nth-child(12) { animation-delay: 0.60s; }

/* ====== ПОПУЛЯРНЫЕ ====== */
.popular-section { margin: 30px 0; }
.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.popular-card {
    display: block;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}
.popular-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.popular-image {
    position: relative;
    padding: 10px;
    background: #f5f7fa;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popular-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.popular-downloads {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}
.popular-downloads i { font-size: 10px; }
.popular-info { padding: 10px 14px; }
.popular-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.popular-meta { font-size: 12px; color: #888; margin-top: 2px; }

/* ====== ИСТОРИЯ ====== */
.history-section {
    margin: 30px 0;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.history-header h3 { font-size: 18px; color: #1a1a2e; margin: 0; display: flex; align-items: center; gap: 8px; }
.history-header h3 i { color: #2196F3; }
.history-clear {
    padding: 4px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #dc2626;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.history-clear:hover { background: #fee2e2; border-color: #dc2626; }
.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8faf9;
    border-radius: 12px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.history-item:hover {
    background: #eef2f6;
    border-color: #2196F3;
    transform: translateY(-2px);
}
.history-item img { width: 48px; height: 32px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #e5e7eb; }
.history-title { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-platform { font-size: 10px; text-transform: uppercase; background: rgba(0,0,0,0.06); padding: 2px 8px; border-radius: 12px; color: #666; }
.history-time { font-size: 11px; color: #999; flex-shrink: 0; }
.history-empty { text-align: center; padding: 30px; color: #999; }
.history-empty i { font-size: 36px; display: block; margin-bottom: 8px; color: #ddd; }
.history-empty p { margin: 0; font-size: 15px; }
.history-empty small { font-size: 13px; }

/* ====== ИЗБРАННОЕ ====== */
.favorites-section { margin: 30px 0; display: none; }
.favorites-section.visible { display: block; }
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.favorite-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
    text-align: center;
}
.favorite-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.favorite-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f7fa;
}
.favorite-title { font-size: 13px; font-weight: 500; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.favorite-platform { font-size: 11px; color: #888; text-transform: uppercase; }
.empty-message { text-align: center; padding: 30px; color: #999; background: white; border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.empty-message i { font-size: 36px; display: block; margin-bottom: 8px; color: #ddd; }

/* ====== ПЛАТФОРМА ОПИСАНИЕ ====== */
.platform-description {
    margin-top: 30px;
    padding: 24px 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    border-left: 4px solid #2196F3;
}
.platform-description h2 { font-size: 20px; margin-bottom: 10px; color: #1a1a2e; }
.platform-description p { margin-bottom: 10px; }
.platform-description .benefits {
    margin-top: 16px;
    padding: 16px 20px;
    background: #f8faf9;
    border-radius: 12px;
}
.platform-description .benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
.platform-description .benefits li {
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e8ecef;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.platform-description .benefits li i { color: #2196F3; font-size: 16px; }

/* ====== РУКОВОДСТВО ====== */
.usage-guide {
    margin: 30px 0;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    background: white;
}
.usage-guide summary {
    padding: 16px 24px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    color: #2196F3;
    transition: background 0.3s;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}
.usage-guide summary::-webkit-details-marker { display: none; }
.usage-guide summary:hover { background: #f0f0f0; }
.usage-guide .content { padding: 24px; line-height: 1.8; }
.guide-steps { display: grid; gap: 12px; counter-reset: step; }
.guide-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 15px;
}
.guide-step::before {
    counter-increment: step;
    content: counter(step);
    width: 32px;
    height: 32px;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 14px;
}

/* ====== ПОДВАЛ ====== */
.footer { text-align: center; padding: 30px 0 20px; color: #999; font-size: 14px; margin-top: 30px; border-top: 1px solid #e0e0e0; }
.footer a { color: #2196F3; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.disclaimer { margin-top: 20px; font-size: 13px; color: #999; }
.disclaimer details { border: 1px solid #e0e0e0; border-radius: 12px; padding: 12px 16px; background: #fafafa; }
.disclaimer summary { cursor: pointer; font-weight: 500; color: #666; display: flex; align-items: center; gap: 8px; }
.disclaimer summary i { color: #2196F3; }

/* ====== ПОИСК ====== */
.search-section { margin: 20px 0; }
.search-wrapper {
    display: flex;
    gap: 10px;
}
.search-wrapper input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
    background: white;
}
.search-wrapper input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 4px rgba(33,150,243,0.1);
}
.search-wrapper button {
    padding: 12px 24px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-wrapper button:hover { background: #1976D2; transform: translateY(-2px); }
.search-results {
    margin-top: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    text-decoration: none;
    color: #1a1a2e;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
}
.search-result-item:hover { background: #f8faf9; }
.search-result-item img { width: 60px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 12px; color: #888; margin-top: 2px; }
.platform-badge-small {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    background: #eef2f6;
    font-size: 10px;
    text-transform: uppercase;
}
.search-loading, .search-empty, .search-error { padding: 20px; text-align: center; color: #999; }
.search-loading i, .search-empty i, .search-error i { margin-right: 8px; }

/* ====== ЗАГРУЗКА ====== */
.loading-indicator { display: none; text-align: center; padding: 40px 20px; }
.spinner { width: 56px; height: 56px; border: 4px solid #f3f3f3; border-top: 4px solid #2196F3; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error-message { display: none; padding: 16px 20px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 16px; color: #dc2626; margin: 20px 0; text-align: center; }
.results-container {
    display: none;
    margin-bottom: 40px; /* Отступ снизу */
}

/* ====== ПОСЛЕДНИЕ ПРЕВЬЮ ====== */
.recent-section {
    margin-top: 30px; /* Отступ сверху */
}
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 20px; }
.result-card { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: all 0.3s; animation: fadeInUp 0.4s ease forwards; opacity: 0; }
.result-card:hover { transform: translateY(-6px); box-shadow: 0 8px 35px rgba(0,0,0,0.12); }
.result-card .thumb-wrap { background: #f5f7fa; padding: 16px; position: relative; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.result-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.result-card .quality-badge { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,0.7); color: white; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; backdrop-filter: blur(4px); }
.result-card .resolution-badge { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.6); color: white; padding: 3px 10px; border-radius: 12px; font-size: 10px; backdrop-filter: blur(4px); }
.result-card .card-actions { padding: 14px 16px; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid #f0f0f0; }
.result-card .btn-download { flex: 1; min-width: 50px; padding: 8px 12px; border: none; border-radius: 12px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; font-family: inherit; color: white; }
.result-card .btn-download:hover { transform: scale(1.05); }
.result-card .btn-download.primary { background: #2196F3; color: white; }
.result-card .btn-download.primary:hover { background: #1976D2; }
.result-card .btn-download.success { background: #4CAF50; color: white; }
.result-card .btn-download.success:hover { background: #388E3C; }
.result-card .btn-download.warning { background: #FF9800; color: white; }
.result-card .btn-download.warning:hover { background: #F57C00; }
.result-card .btn-download.gray { background: #607D8B; color: white; }
.result-card .btn-download.gray:hover { background: #455A64; }

/* ====== СТРАНИЦА ПРЕВЬЮ ====== */
.page-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    margin-top: 20px;
}
.main-content { background: white; border-radius: 16px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.sidebar { position: sticky; top: 20px; align-self: start; }
.sidebar .sidebar-card { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 20px; }
.sidebar .sidebar-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.sidebar .sidebar-title i { color: #2196F3; }
.sidebar .sidebar-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: #1a1a2e; align-items: center; }
.sidebar .sidebar-item:hover { color: #2196F3; }
.sidebar .sidebar-item img { width: 50px; height: 35px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #f5f7fa; }
.sidebar .sidebar-item .title { font-size: 13px; font-weight: 500; line-height: 1.2; }
.sidebar .sidebar-item .platform { font-size: 10px; color: #888; text-transform: uppercase; display: flex; align-items: center; gap: 4px; }
.sidebar .sidebar-item .platform img { width: 12px; height: 12px; object-fit: contain; }

.breadcrumbs {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.breadcrumbs a { color: #2196F3; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .separator { color: #ccc; }
.breadcrumbs .platform-link img { width: 16px; height: 16px; object-fit: contain; }
.breadcrumbs .current { color: #666; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.breadcrumbs .current i { font-size: 13px; color: #2196F3; }

.platform-icon-only {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
    padding: 4px 0;
}
.platform-icon-only img { width: 24px; height: 24px; object-fit: contain; }

h1 { font-size: 28px; margin: 16px 0 10px; color: #1a1a2e; line-height: 1.2; }

.image-wrap { text-align: center; margin: 16px 0; background: #f5f7fa; border-radius: 16px; padding: 20px; }
.image-wrap img { max-width: 100%; max-height: 70vh; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

.download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.btn-download {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-family: inherit;
    flex: 1;
    min-width: 100px;
    justify-content: center;
}
.btn-download:hover { transform: translateY(-3px); box-shadow: 0 6px 25px rgba(0,0,0,0.2); }
.btn-download:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-download.primary { background: #2196F3; }
.btn-download.primary:hover { background: #1976D2; }
.btn-download.success { background: #4CAF50; }
.btn-download.success:hover { background: #388E3C; }
.btn-download.warning { background: #FF9800; }
.btn-download.warning:hover { background: #F57C00; }
.btn-download.gray { background: #607D8B; }
.btn-download.gray:hover { background: #455A64; }

.stats-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #f8faf9;
    border-radius: 12px;
    margin: 12px 0;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}
.stat-item .stat-icon { color: #2196F3; font-size: 16px; }
.stat-item .stat-number { font-weight: 700; font-size: 16px; color: #1a1a2e; }
.stat-item .stat-label { font-size: 13px; color: #888; }
.stat-item.highlight .stat-number { color: #2196F3; }

.video-source {
    padding: 12px 16px;
    background: #f8faf9;
    border-radius: 12px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.video-source a { color: #2196F3; text-decoration: none; font-weight: 500; }
.video-source a:hover { text-decoration: underline; }

.share-section { margin: 16px 0 8px; padding-top: 16px; border-top: 1px solid #f0f0f0; }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-share {
    padding: 8px 16px; border: 1px solid #e0e0e0; border-radius: 12px;
    background: white; cursor: pointer; font-size: 13px; font-weight: 500;
    color: #333; transition: all 0.2s; font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-share:hover { background: #2196F3; color: white; border-color: #2196F3; transform: translateY(-2px); }
.btn-favorite {
    padding: 8px 16px; border: 1px solid #e0e0e0; border-radius: 12px;
    background: white; cursor: pointer; font-size: 13px; font-weight: 500;
    color: #333; transition: all 0.2s; font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-favorite:hover { background: #FBBF24; color: white; border-color: #FBBF24; }
.btn-favorite.active { background: #FBBF24; color: white; border-color: #FBBF24; }

.qr-container { margin-top: 12px; text-align: center; padding: 16px; background: #f8faf9; border-radius: 12px; }
.qr-container p { margin-top: 12px; font-size: 13px; color: #888; }
#qrCode { display: inline-block; background: white; padding: 8px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.seo-text { margin-top: 30px; padding: 20px; background: #f8faf9; border-radius: 16px; font-size: 14px; line-height: 1.8; color: #444; }
.seo-text h2 { font-size: 20px; margin-bottom: 10px; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.seo-text h2 i { color: #2196F3; }
.seo-text strong { color: #1a1a2e; }

.back-link { display: inline-block; margin-top: 16px; color: #2196F3; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.back-link:hover { text-decoration: underline; }

.platform-link {
    display: flex; align-items: center; gap: 10px;
    color: #2196F3; text-decoration: none; font-size: 13px;
    padding: 6px 10px; border-radius: 8px; transition: background 0.2s;
}
.platform-link:hover { background: #f0f4f8; }
.platform-link img { width: 20px; height: 20px; object-fit: contain; }

/* ====== АРХИВ ====== */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.archive-card {
    display: block;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s;
    text-decoration: none;
    color: #1a1a2e;
}
.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.archive-card .image-wrap {
    background: #f5f7fa;
    padding: 12px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.archive-card .image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.archive-card .platform-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    padding: 4px 8px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}
.archive-card .platform-badge img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
.archive-card .card-info {
    padding: 12px 14px;
}
.archive-card .card-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.archive-card .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}
.archive-card .card-downloads {
    display: flex;
    align-items: center;
    gap: 4px;
}
.archive-card .card-downloads i { font-size: 11px; }

/* ====== ПАГИНАЦИЯ ====== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}
.pagination a {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    color: #333;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pagination a:hover {
    background: #f0f4f8;
    border-color: #2196F3;
}
.pagination a.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* ====== ФИЛЬТРЫ ====== */
.filters {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: center;
}
.filters select {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.3s;
}
.filters select:focus {
    outline: none;
    border-color: #2196F3;
}
.filters .filter-label {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}
.footer-actions {
    text-align: center;
    padding: 20px 0;
}
.footer-actions a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.footer-actions a:hover {
    text-decoration: underline;
}

/* ====== ПУСТОЕ СОСТОЯНИЕ ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state i {
    font-size: 48px;
    color: #ddd;
    display: block;
    margin-bottom: 16px;
}
.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}
.empty-state small {
    font-size: 14px;
}

/* ====== TOAST ====== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: #1a1a2e;
    color: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
    max-width: 90%;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast i { font-size: 18px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ====== ЗАГРУЗКА ДЛЯ ПОПУЛЯРНЫХ ====== */
.loading-spinner {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
    grid-column: 1 / -1;
}
.loading-spinner i { margin-right: 8px; }

/* ====== АДАПТИВ ====== */
@media (max-width: 992px) {
    .page-content { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .sidebar .sidebar-card { display: none; }
}
@media (max-width: 768px) {
    .container { padding: 12px; }
    .header { padding: 20px 0; }
    .logo { font-size: 20px; padding: 10px 16px; gap: 10px; }
    .logo-icon { width: 36px; height: 36px; font-size: 18px; }
    .main-content { padding: 16px; }
    h1 { font-size: 22px; }
    .btn-download { min-width: 100%; }
    .download-buttons { flex-direction: column; }
    .recent-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .stats-bar { font-size: 12px; gap: 8px; }
    .stats-bar span { padding: 3px 10px; }
    .platform-description { padding: 16px 20px; }
    .platform-description .benefits ul { grid-template-columns: 1fr; }
    .history-list { grid-template-columns: 1fr; }
    .popular-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .favorites-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .search-wrapper { flex-direction: column; }
    .archive-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .filters { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
    .logo { font-size: 17px; }
    .btn-platform { font-size: 12px; padding: 8px 14px; }
    .btn-platform .platform-icon { width: 18px; height: 18px; }
    .guide-step { font-size: 13px; padding: 10px 14px; }
    .recent-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .popular-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .favorites-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .history-item { flex-wrap: wrap; gap: 6px; }
    .history-title { width: 100%; white-space: normal; line-height: 1.3; }
    .seo-text { padding: 14px; font-size: 13px; }
    .video-source { font-size: 13px; flex-wrap: wrap; }
    .platform-description { padding: 12px 16px; font-size: 14px; }
    .archive-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .results-grid { grid-template-columns: 1fr; }
}