/* ===============================================
   MAIN STYLESHEET
   =============================================== */

/* -----------------------------------------------
   1. CSS Variables & Root
   ----------------------------------------------- */
:root {
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-gradient-alt: linear-gradient(135deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --danger-gradient: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    --btn-primary-gradient: linear-gradient(145deg, #0d6efd, #0b5ed7);
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Shadows */
    --shadow-premium: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 15px 30px rgba(13,110,253,0.4);
    --shadow-danger: 0 4px 12px rgba(220, 53, 69, 0.3);
    
    /* Colors */
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --danger-color: #dc3545;
    --danger-dark: #c82333;
    
    /* Transitions */
    --transition-default: all 0.3s ease;
	
	/* Avatar ring */
	--ring:#dfe7ff; --accent:#3b82f6; --shadow:0 8px 20px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.04);
}


	

 /* ---------- AVATAR RING + STATUS DOT ---------- */
    .avatar-ring{position:relative; display:inline-block; padding:6px; border-radius:50%; background:
      conic-gradient(from 140deg,#fff 0 20%, var(--ring) 20% 70%, #fff 70% 100%)}
    .avatar-ring>*{display:block; border-radius:50%}

/* -----------------------------------------------
   2. Global Keyframes Animations
   ----------------------------------------------- */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shrinkWidth {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -----------------------------------------------
   3. Background Elements
   ----------------------------------------------- */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-gradient);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 { width: 200px; height: 200px; top: 10%; left: 5%; animation-delay: 0s; }
.shape-2 { width: 150px; height: 150px; top: 60%; right: 10%; animation-delay: 2s; }
.shape-3 { width: 100px; height: 100px; bottom: 20%; left: 15%; animation-delay: 4s; }

/* -----------------------------------------------
   4. Particles Animation
   ----------------------------------------------- */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0.2;
    animation: float 4s ease-in-out infinite;
}

/* -----------------------------------------------
   5. Hero Section
   ----------------------------------------------- */
.hero-card {
    background: var(--primary-gradient);
    color: white;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-title {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* -----------------------------------------------
   6. Breadcrumb Improvements
   ----------------------------------------------- */
.breadcrumb-container {
    position: relative;
}

.breadcrumb-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 4px 4px 0 0;
    width: 66%;
    transition: width 0.3s ease;
}

.breadcrumb-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* -----------------------------------------------
   7. Hover Effects
   ----------------------------------------------- */
.hover-lift {
    transition: var(--transition-default);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.btn-hover-glow:hover {
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
}

.transition-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.transition-scale:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

/* -----------------------------------------------
   8. Advanced Stat Cards
   ----------------------------------------------- */
.stat-card.advanced {
    border-left: 4px solid;
    transition: var(--transition-default);
}

.stat-card.advanced:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

.stat-card.advanced:nth-child(1) { border-left-color: #28a745; }
.stat-card.advanced:nth-child(2) { border-left-color: #ffc107; }
.stat-card.advanced:nth-child(3) { border-left-color: #17a2b8; }

.mega-progress {
    height: 12px;
    background: rgba(0,0,0,0.1);
}

/* -----------------------------------------------
   9. Smart Tabs
   ----------------------------------------------- */
.smart-tab {
    transition: var(--transition-default);
    border: 2px solid transparent;
}

.smart-tab.active {
    background: var(--primary-gradient) !important;
    border-color: rgba(255,255,255,0.3);
    color: white !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.smart-tab:not(.active):hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
}

.tab-icon {
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.smart-tab.active .tab-icon {
    background: rgba(255,255,255,0.2);
}

/* -----------------------------------------------
   10. Download Icon Animation
   ----------------------------------------------- */
.download-main-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

/* -----------------------------------------------
   11. Animated Wave
   ----------------------------------------------- */
.animated-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.8) 50%, 
        transparent 100%);
    animation: wave 2s linear infinite;
}

/* -----------------------------------------------
   12. Section Titles
   ----------------------------------------------- */
.section-title {
    color: #2c3e50;
    font-weight: 600;
}

/* -----------------------------------------------
   13. Image Modal Enhancements
   ----------------------------------------------- */
.zoomable-image {
    cursor: zoom-in;
}

.image-viewport {
    transition: transform 0.3s ease;
}

.screenshot-wrapper:hover img {
    opacity: 0.9;
}

/* -----------------------------------------------
   14. Icon & Dropdown Enhancements
   ----------------------------------------------- */
.btn-icon {
    transition: var(--transition-default);
    border: 1px solid #e9ecef;
}

.btn-icon:hover {
    transform: scale(1.1);
    border-color: #007bff;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.dropdown-item {
    transition: var(--transition-default);
}

.dropdown-item:hover {
    background: #007bff;
    color: white;
    margin-left: 5px;
    margin-right: -5px;
    border-radius: 6px;
}

/* -----------------------------------------------
   15. Magnet Modal Specific Styles
   ----------------------------------------------- */
.icon-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    animation: pulse 3s infinite;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.fa-spin-slow {
    animation: spin-slow 3s linear infinite;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

/* -----------------------------------------------
   16. Delete Torrent Modal Styles
   ----------------------------------------------- */
#deleteTorrentModal .modal-content {
    border-radius: 12px;
    overflow: hidden;
}

#deleteTorrentModal .modal-header {
    border-bottom: none;
    padding: 1.5rem 1.5rem 1rem;
}

#deleteTorrentModal .modal-body {
    padding: 0 1.5rem;
}

#deleteTorrentModal .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    background: rgba(0,0,0,0.02);
}

#deleteTorrentModal .btn {
    border-radius: 8px;
    font-weight: 500;
}

#confirmDeleteBtn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-danger);
}

#deleteTorrentModal .form-check-input:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* -----------------------------------------------
   17. General Modal Styles
   ----------------------------------------------- */
.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

  

/* -----------------------------------------------
   18. Form Styles
   ----------------------------------------------- */
.form-select, .form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    transition: var(--transition-default);
}

.form-select:focus, .form-control:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-control {
    border-radius: 0 !important;
    border: 1px solid #dee2e6;
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.input-group-text {
    border-radius: 10px 0 0 10px !important;
}

.input-group .btn-primary {
    border-radius: 0 10px 10px 0 !important;
}

/* -----------------------------------------------
   19. Button Styles
   ----------------------------------------------- */
.btn-primary2 {
    background: var(--btn-primary-gradient);
    border: none;
    transition: var(--transition-default);
}

.btn-primary2:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary) !important;
}

.btn-outline-primary2 {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    transition: var(--transition-default);
}

.btn-outline-primary2:hover {
    background: var(--btn-primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(13,110,253,0.3);
}

.btn2 {
    transition: var(--transition-default);
}

/* Submit Report Button */
#submitReport {
    transition: var(--transition-default);
}

#submitReport:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-danger);
}

/* -----------------------------------------------
   20. Text Utilities
   ----------------------------------------------- */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75);
}

.bg-gradient {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* -----------------------------------------------
   21. Magnet Loading Animation
   ----------------------------------------------- */
.magnet-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.magnet-loading-content {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-premium);
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: slideInRight 0.3s ease;
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.magnet-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

.magnet-spinner.success {
    border-top-color: #10b981;
}

.magnet-spinner.error {
    border-top-color: #ef4444;
}

.magnet-loading-text {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.magnet-loading-progress {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.magnet-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* -----------------------------------------------
   22. Responsive Design
   ----------------------------------------------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .smart-tab {
        padding: 1rem !important;
    }
    
    .tab-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .icon-circle {
        width: 70px;
        height: 70px;
    }
    
    .icon-circle i {
        font-size: 2rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .d-flex.gap-3 {
        flex-wrap: wrap;
    }
    
    .magnet-loading-content {
        padding: 1.5rem;
    }
    
    .magnet-spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .magnet-loading-text {
        font-size: 0.9rem;
    }
}

/* -----------------------------------------------
   23. Dark Mode Enhancements
   ----------------------------------------------- */
/* Реагирует на реальный переключатель темы сайта ([data-bs-theme="dark"]
   на <html>), не на настройку ОС/браузера - раньше был
   @media (prefers-color-scheme: dark), никак не связанный с самим
   переключателем на сайте. */
[data-bs-theme="dark"] .bg-light {
    background-color: #2d3748 !important;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .text-dark {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #a0aec0 !important;
}

[data-bs-theme="dark"] .card {
    background-color: #2d3748;
    border-color: #4a5568;
}

[data-bs-theme="dark"] .magnet-loading-overlay {
    background: rgba(26, 32, 44, 0.95);
}

[data-bs-theme="dark"] .magnet-loading-content {
    background: #2d3748;
    border-color: #4a5568;
}

[data-bs-theme="dark"] .magnet-loading-text {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .magnet-spinner {
    border-color: #4a5568;
}

/* -----------------------------------------------
   24. Utility Classes
   ----------------------------------------------- */
.magnet-btn {
    transition: var(--transition-default);
}

.magnet-btn:active {
    transform: scale(0.95);
}

.magnet-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* ===== Rating widget ===== */
.rating-modern { background:#fff; border-radius:16px; padding:16px 20px; box-shadow:0 2px 8px rgba(0,0,0,0.06); transition:all 0.2s; }
.rating-modern:hover { box-shadow:0 4px 16px rgba(0,0,0,0.1); }
.rating-score { font-size:2.2rem; font-weight:800; color:#1a1a2e; line-height:1; }
.rating-stars { display:flex; gap:4px; font-size:1rem; }
.rating-star-filled { color:#f59e0b; }
.rating-star-empty { color:#e9ecef; }
.user-star { font-size:1.5rem; cursor:pointer; transition:0.15s; color:#dee2e6; }
.user-star:hover { transform:scale(1.15); color:#f59e0b !important; }
.user-star.active { color:#f59e0b; }
@media(max-width:768px) { .rating-score { font-size:1.8rem; } .user-star { font-size:1.2rem; } }

/* ===== Similar Torrents Cards ===== */
.similar-torrent-card {
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.similar-torrent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

.similar-overlay {
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.similar-torrent-card:hover .similar-overlay {
    opacity: 1;
}

.similar-torrent-card:hover img {
    transform: scale(1.05);
}


/* ══════════════════════════════════════════════════════════════════
   details-extras.css - вынесенные позже дополнения (вынос из инлайна,
   hero-блок, тёмная тема)
   ══════════════════════════════════════════════════════════════════ */

/* details-extras.css — вынесено из details.php */

/* ══════════════════════════════════════════════════════════════════
   DETAILS PAGE — CLEANED STYLES
   ══════════════════════════════════════════════════════════════════ */

/* ── Breadcrumb ─────────────────────────────────────────────────── */
.torrent-breadcrumb {
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%) !important;
    border: 1px solid #eef0f5;
}
.torrent-breadcrumb .breadcrumb-item a {
    color: #5a6b85;
    font-weight: 500;
    transition: color .16s ease;
}
.torrent-breadcrumb .breadcrumb-item a:hover {
    color: #0d6efd;
}
.torrent-breadcrumb .breadcrumb-item.active {
    color: #18233b;
    font-weight: 600;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #adb5bd;
    font-size: 1.1rem;
    line-height: 1;
}

/* ── Header / Hero icon ─────────────────────────────────────────── */
.torrent-hero-icon {
    flex: 0 0 72px;
    width: 72px; height: 72px;
    display: grid; place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #eef4ff, #dbe7ff);
    color: #0d6efd;
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(13, 110, 253, .15);
    transition: transform .25s ease;
}
.torrent-hero-icon:hover {
    transform: scale(1.05) rotate(-4deg);
    color: #6657e8;
}

/* ── Meta badges ────────────────────────────────────────────────── */
.torrent-meta-badges .meta-badge {
    padding: .5em .85em;
    font-weight: 600;
    font-size: .78rem;
    border-radius: 9px;
    letter-spacing: .01em;
    transition: transform .16s ease, box-shadow .16s ease;
}
.torrent-meta-badges .meta-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.torrent-meta-badges .meta-badge i {
    filter: grayscale(100%);
    opacity: .85;
    transition: opacity .18s ease;
}
.torrent-meta-badges .meta-badge:hover i { opacity: 1; }

.meta-badge-id      { background: #f1f3f5; color: #495057; border: 1px solid #dee2e6; }
.meta-badge-size    { background: rgba(102,87,232,.1); color: #6657e8; border: 1px solid rgba(102,87,232,.25); }
.meta-badge-files   { background: rgba(255,193,7,.15); color: #997404; border: 1px solid rgba(255,193,7,.3); }
.meta-badge-date    { background: rgba(108,117,125,.12); color: #495057; border: 1px solid rgba(108,117,125,.25); }
.meta-badge-snatched{ background: rgba(13,202,240,.15); color: #0aa2c0; border: 1px solid rgba(13,202,240,.3); }

/* ── Action card ────────────────────────────────────────────────── */
.action-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #eef0f5;
}
.action-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #4f8eff 100%);
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 8px 20px rgba(13,110,253,.25);
    flex-shrink: 0;
}
.btn-download-pulse {
    background: linear-gradient(135deg, #0d6efd, #4d94ff) !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(13,110,253,.3);
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn-download-pulse:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(13,110,253,.45);
}

/* ── Health progress ────────────────────────────────────────────── */
.health-progress-wrap { padding: 0 .25rem; }
.health-progress {
    height: 10px;
    border-radius: 6px;
    background: #f1f3f5;
    overflow: hidden;
}
.health-progress .progress-bar {
    border-radius: 6px;
    transition: width .4s ease;
}

/* ── Stat tiles ─────────────────────────────────────────────────── */
.stat-tile {
    display: flex; align-items: center; gap: 12px;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef0f5;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.stat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.stat-tile-icon {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform .2s ease;
}
.stat-tile:hover .stat-tile-icon { transform: scale(1.08) rotate(-4deg); }
.stat-tile-success   .stat-tile-icon { background: linear-gradient(135deg, #d1e7dd, #a3d9b8); color: #0f5132; }
.stat-tile-warning   .stat-tile-icon { background: linear-gradient(135deg, #fff3cd, #ffe69c); color: #997404; }
.stat-tile-info      .stat-tile-icon { background: linear-gradient(135deg, #cff4fc, #9eeaf9); color: #055160; }
.stat-tile-secondary .stat-tile-icon { background: linear-gradient(135deg, #e2e3e5, #cfd2d5); color: #41464b; }
.stat-tile-value { font-size: 1.25rem; font-weight: 700; line-height: 1.1; color: #18233b; }
.stat-tile-label { font-size: .78rem; color: #8a8f98; margin-top: 2px; }
.stat-tile-label i { opacity: .8; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.nav-tabs-scrollable {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid #eef0f5;
}
.nav-tabs-scrollable::-webkit-scrollbar { display: none; }
.nav-tabs-scrollable .nav-link {
    white-space: nowrap;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: .85rem 1.25rem;
    transition: all .2s;
}
.nav-tabs-scrollable .nav-link i { transition: transform .18s ease; }
.nav-tabs-scrollable .nav-link:hover {
    color: #0d6efd;
    background: #f8f9ff;
    border-bottom-color: #e0e9ff;
}
.nav-tabs-scrollable .nav-link:hover i { transform: scale(1.15); }
.nav-tabs-scrollable .nav-link.active {
    color: #0d6efd;
    background: transparent;
    border-bottom-color: #0d6efd;
}

/* ── Info tab (2-col layout) ────────────────────────────────────── */
.info-grid {
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    padding: .25rem 1rem;
    height: 100%;
    transition: box-shadow .2s ease;
}
.info-grid:hover { box-shadow: 0 6px 20px rgba(0,0,0,.04); }

.info-item { transition: background .16s ease; }
.info-item:hover { background: #fafbff; border-radius: 8px; }
.info-item:last-child { border-bottom: none !important; }

.info-item > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .88rem;
    font-weight: 500;
    flex-shrink: 0;
}
.info-item > span:last-child {
    max-width: 65%;
    word-break: break-word;
    text-align: right;
    font-size: .9rem;
}

/* Чёрно-белые иконки */
.info-item > span:first-child i,
.tag-section h6 i {
    color: #1a1a1a !important;
    opacity: .65;
    filter: grayscale(100%);
    transition: color .18s ease, opacity .18s ease, transform .18s ease;
    font-size: 1rem;
    vertical-align: -1px;
}
.info-item:hover > span:first-child i {
    color: #000 !important;
    opacity: 1;
    transform: scale(1.15);
}

/* Бейджи в правой колонке */
.info-item .badge.bg-light {
    background: #f1f3f5 !important;
    border: 1px solid #e6e8eb;
    color: #1a1a1a !important;
    font-weight: 600;
    font-size: .82rem;
    padding: .35em .8em;
    border-radius: 7px;
    transition: background .16s ease, transform .16s ease;
}
.info-item .badge.bg-light:hover {
    background: #e9ecef !important;
    transform: translateY(-1px);
}
.info-item .badge.bg-light a { color: #1a1a1a !important; font-weight: 700; }

.info-item .font-monospace {
    font-size: .78rem;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 5px;
    word-break: break-all;
}

/* ── Tags section ───────────────────────────────────────────────── */
.tag-section { padding-top: .5rem; }
.tag-section .tag-badge {
    background: linear-gradient(135deg, #0d6efd, #4d94ff) !important;
    border-radius: 8px;
    padding: .5em .85em;
    font-weight: 600;
    font-size: .78rem;
    color: #fff !important;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease;
}
.tag-section .tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,110,253,.3);
}

/* ── Rating ─────────────────────────────────────────────────────── */
.rating-panel {
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #e5e7f0;
}
.rating-panel-header {
    display: flex; align-items: center; gap: 8px;
    padding-bottom: .85rem;
    border-bottom: 1px solid #eef0f5;
    font-weight: 600;
    color: #18233b;
}
.rating-score-wrap {
    text-align: center;
    padding: 0 1rem;
    border-right: 1px solid #e5e7f0;
}
/* .rating-score, .rating-star-filled, .rating-star-empty, .user-star -
   убраны отсюда, конфликтовали с details.css (тот побеждал по порядку
   загрузки, но эти правила были мёртвым дублем, путающим при правке).
   Актуальные версии теперь только в details.css. */
.rating-score-max {
    font-size: .9rem;
    color: #495057;
    opacity: .7;
    margin-top: .1rem;
}
.rating-votes { font-size: .75rem; }
.rating-stars-wrap { padding-left: .5rem; }
.rating-stars i { font-size: 1.25rem; }

/* ── Similar torrents ───────────────────────────────────────────── */
.similar-wrapper { border-radius: 14px; overflow: hidden; }
.similar-header {
    background: linear-gradient(90deg, #f8f9ff, #ffffff);
    border-bottom: 1px solid #eef0f5;
}
/* .similar-torrent-card, .similar-overlay - тоже убраны, та же причина -
   актуальные версии в details.css. */

/* ── File tree ──────────────────────────────────────────────────── */
.file-tree .accordion-item {
    border: 1px solid #eef0f5;
    margin-bottom: .35rem;
    border-radius: 10px;
    overflow: hidden;
}
.file-tree .accordion-button {
    padding: .65rem 1rem;
    font-size: .9rem;
    background: #fafbfc;
    box-shadow: none;
}
.file-tree .accordion-button:not(.collapsed) {
    background: #f0f6ff;
    color: #0d6efd;
}
.file-tree .accordion-body { padding: .65rem 1rem; }

/* ── Poster strip ───────────────────────────────────────────────── */
.poster-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: .5rem 0;
}
.poster-strip > a {
    display: block;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    transition: transform .25s ease, box-shadow .25s ease;
    max-width: 400px;
}
.poster-strip > a:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 26px rgba(0,0,0,.15);
}
.poster-strip img {
    display: block; width: 100%; height: auto;
    max-height: 720px;
    object-fit: cover;
    border-radius: 12px;
}

/* ── Manage icons ───────────────────────────────────────────────── */
.manage-btn { transition: transform .18s ease; }
.manage-btn:hover { transform: rotate(90deg); }
.manage-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 9px;
    background: #f8f9fa;
    border: 1px solid #eef0f5;
    margin: 0 2px;
    transition: background .18s ease, transform .18s ease;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
}
.manage-icon-btn:hover { background: #eef4ff; transform: translateY(-2px); }
.manage-icon-btn i { font-size: 1.1rem; }
.manage-icon-btn button { background: none; border: none; padding: 0; }

/* ── Hit & Run warning ──────────────────────────────────────────── */
.hitrun-alert {
    background: linear-gradient(135deg, #fff5f5, #ffe0e0);
    border: 1px solid #f5c2c7;
    border-left: 4px solid #dc3545;
    color: #842029;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: .9rem;
}

/* ── Comments empty ─────────────────────────────────────────────── */
.comments-empty-card {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,.05);
}

/* ── IMDb card ──────────────────────────────────────────────────── */
.imdb-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eef0f5;
}
.imdb-header {
    background: linear-gradient(90deg, #fff8e6, #fff1c8);
    border-bottom: 1px solid #ffe69c;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes tilePop {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}
.stat-tile { animation: tilePop .3s ease backwards; }
.row > .col-6:nth-child(1) .stat-tile { animation-delay: .05s; }
.row > .col-6:nth-child(2) .stat-tile { animation-delay: .12s; }
.row > .col-6:nth-child(3) .stat-tile { animation-delay: .19s; }
.row > .col-6:nth-child(4) .stat-tile { animation-delay: .26s; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .torrent-hero-icon { width: 56px; height: 56px; font-size: 1.5rem; flex: 0 0 56px; }
    .stat-tile-value { font-size: 1.05rem; }
    .info-item > span:last-child { max-width: 60%; }
    .poster-strip > a { max-width: 100%; }
}

/* ── Dark mode ──────────────────────────────────────────────────── */
/* Реагирует на реальный переключатель темы сайта ([data-bs-theme="dark"]
   на <html>, ставится JS в шапке + сохраняется в localStorage), а не на
   настройку ОС/браузера - раньше было @media (prefers-color-scheme: dark),
   что было полностью не связано с самим переключателем на сайте. */
[data-bs-theme="dark"] body {
    background: #0f1420;
    color: #d6dced;
}
[data-bs-theme="dark"] .action-card,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .stat-tile,
[data-bs-theme="dark"] .rating-panel,
[data-bs-theme="dark"] .info-grid {
    background: #1a2030 !important;
    border-color: #2a3448 !important;
    color: #d6dced;
}
[data-bs-theme="dark"] .card-header.bg-light {
    background: #232b3e !important;
    border-bottom: 1px solid #2a3448;
    color: #b9c8e4;
}
[data-bs-theme="dark"] .info-item:hover { background: #232b3e; }
[data-bs-theme="dark"] .info-item > span:first-child { color: #8fa0bd; }
[data-bs-theme="dark"] .info-item > span:first-child i,
[data-bs-theme="dark"] .tag-section h6 i {
    color: #f0f3fa !important;
    opacity: .7;
}
[data-bs-theme="dark"] .info-item:hover > span:first-child i,
[data-bs-theme="dark"] .tag-section h6:hover i {
    color: #ffffff !important;
    opacity: 1;
}
[data-bs-theme="dark"] .info-item > span:last-child { color: #d6dced; }
[data-bs-theme="dark"] .info-item .badge.bg-light {
    background: #232b3e !important;
    border-color: #2a3448;
    color: #d6dced !important;
}
[data-bs-theme="dark"] .info-item .badge.bg-light a { color: #6ea8ff !important; }
[data-bs-theme="dark"] .info-item .font-monospace {
    background: #232b3e;
    color: #b9c8e4;
}
[data-bs-theme="dark"] .breadcrumb,
[data-bs-theme="dark"] .torrent-breadcrumb {
    background: #1a2030 !important;
    border-color: #2a3448;
}
[data-bs-theme="dark"] .breadcrumb-item a { color: #8fa8d4; }
[data-bs-theme="dark"] .torrent-header h1 { color: #f0f3fa !important; }
[data-bs-theme="dark"] .stat-tile-value { color: #f0f3fa; }
[data-bs-theme="dark"] .nav-tabs-scrollable { border-bottom-color: #2a3448; }
[data-bs-theme="dark"] .nav-tabs-scrollable .nav-link { color: #8fa0bd; }
[data-bs-theme="dark"] .nav-tabs-scrollable .nav-link.active,
[data-bs-theme="dark"] .nav-tabs-scrollable .nav-link:hover {
    color: #6ea8ff;
}
[data-bs-theme="dark"] .torrent-meta-badges .meta-badge i {
    filter: grayscale(100%) brightness(1.8);
}

/* ── IMDb-блок (грузится через AJAX, TS_IMDB()) ──────────────────── */
/* .block-titled и соседние классы приходят со своим встроенным <style>
   (background:#fff и т.д.) в самом AJAX-ответе - не в наших файлах, и
   мы не видим источник. !important нужен, чтобы гарантированно перебить
   встроенный <style>, независимо от того, в каком порядке он попадёт в
   DOM относительно наших стилей. */
[data-bs-theme="dark"] .block-titled {
    background: #1a2030 !important;
    border-color: #2a3448 !important;
    color: #d6dced !important;
}
[data-bs-theme="dark"] .movie-title {
    color: #6ea8ff !important;
}
[data-bs-theme="dark"] .movie-plot {
    color: #a8b3c9 !important;
}
[data-bs-theme="dark"] .badge-extra {
    background: #232b3e !important;
    color: #d6dced !important;
}
[data-bs-theme="dark"] .movie-info div {
    color: #d6dced !important;
}
[data-bs-theme="dark"] .section-title {
    color: #b9c8e4 !important;
    border-bottom-color: #2a3448 !important;
}
[data-bs-theme="dark"] .block-titled a {
    color: #6ea8ff !important;
}