/* Темы оформления */

/* Импорт шрифтов для тем */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&display=swap');

/* Шапка с декоративной картинкой: высота и затемнение для читаемости */
header.has-header-decoration {
    min-height: 4.5rem;
}
header.has-header-decoration .container {
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
header.has-header-decoration::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(30,41,59,0.85) 0%, transparent 35%, transparent 65%, rgba(30,41,59,0.85) 100%);
    pointer-events: none;
    z-index: 1;
}
header.has-header-decoration .container {
    z-index: 2;
}

/* Блок «Похожие торренты»: ссылки всегда кликабельны */
.similar-card a[href^="view.php"] {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* Существующие темы */

/* По умолчанию (DLE) — всегда тёмный фон */
body.theme-default {
    background: #1e293b !important;
}

body.theme-dark_neon { --accent: #3b82f6; --accent2: #eab308; background: #0f172a; }
.theme-dark_neon .dle-block-title { background: linear-gradient(90deg, #1e3a5f 0%, #3b82f6 50%, #eab308 100%); }
.theme-dark_neon .btn-dle { background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%); box-shadow: 0 0 12px rgba(59,130,246,0.5); }

.theme-green_animated .dle-block { border-radius: 0; border: 2px solid #22c55e; }
.theme-green_animated .btn-dle { border-radius: 0; background: #22c55e; }
.theme-green_animated .dle-block-title { background: #166534; }
.theme-green_animated header.has-header-decoration::after { background: linear-gradient(to right, rgba(21,101,52,0.88) 0%, transparent 40%, transparent 60%, rgba(21,101,52,0.88) 100%); }
.theme-green_animated header.dle-block { border-bottom-color: #22c55e; }

body.theme-cinema { background: #0c0c0c; }
.theme-cinema .dle-block { border-radius: 12px; border-color: #404040; }
.theme-cinema .btn-dle { border-radius: 8px; background: #b91c1c; }
.theme-cinema header.has-header-decoration::after { background: linear-gradient(to right, rgba(12,12,12,0.92) 0%, transparent 38%, transparent 62%, rgba(12,12,12,0.92) 100%); }
.theme-cinema header.dle-block { border-bottom-color: #b91c1c; }

body.theme-tracker { background: #0d1117; }
.theme-tracker .dle-block { background: #161b22; border-color: #30363d; }
.theme-tracker .dle-block-title { background: #21262d; }
.theme-tracker .btn-dle { background: #238636; }

.theme-gold_animated .dle-block-title { background: linear-gradient(90deg, #78350f 0%, #f59e0b 100%); }
body.theme-gold_animated { background: #450a0a; }
.theme-gold_animated .btn-dle { background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%); }
.theme-gold_animated header.has-header-decoration::after { background: linear-gradient(to right, rgba(69,10,10,0.9) 0%, transparent 40%, transparent 60%, rgba(69,10,10,0.9) 100%); }
.theme-gold_animated header.dle-block { border-bottom-color: #b45309; }

body.theme-malosolka { background: #1c1917; }
.theme-malosolka .dle-block { background: #292524; border-color: #57534e; }
.theme-malosolka .dle-block-title { background: #44403c; }

body.theme-burgundy { background: #1c0a0a; }
.theme-burgundy .dle-block { background: linear-gradient(180deg, #3d1515 0%, #1c0a0a 100%); border-color: #7f1d1d; }
.theme-burgundy .dle-block-title { background: linear-gradient(90deg, #7f1d1d 0%, #be123c 100%); }
.theme-burgundy .btn-dle { background: linear-gradient(180deg, #be123c 0%, #9f1239 100%); }

/* === Новые темы из themes.php (точная адаптация) === */

/* Ocean (Blue/Cyan) - Floating, Glass, Rounded */
body.theme-ocean { 
    background: #f8fafc;
    font-family: 'Quicksand', sans-serif;
    position: relative;
}
body.theme-ocean::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #f8fafc;
    background-image: 
        radial-gradient(circle at 10% 20%, #e2e8f0 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, #cffafe 0%, transparent 20%),
        linear-gradient(to bottom right, #f8fafc 0%, #f1f5f9 100%);
    background-size: 100% 100%;
}
.theme-ocean .dle-block { 
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.theme-ocean .dle-block-title { 
    background: linear-gradient(90deg, #0e7490 0%, #06b6d4 50%, #0ea5e9 100%);
    border-radius: 2.5rem 2.5rem 0 0;
}
.theme-ocean .btn-dle { 
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 9999px;
    box-shadow: 0 0 20px rgba(6,182,212,0.3);
}
.theme-ocean header.dle-block { 
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.theme-ocean header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(248,250,252,0.9) 0%, transparent 40%, transparent 60%, rgba(248,250,252,0.9) 100%); 
}

/* Forest (Green) - Natural, Organic */
body.theme-forest { 
    background: #f5f5f4;
    font-family: 'Merriweather', serif;
    position: relative;
}
body.theme-forest::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #f5f5f4;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0L20 10L10 20L0 10Z' fill='%2314532d' fill-opacity='0.03'/%3E%3C/svg%3E");
}
.theme-forest .dle-block { 
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e7e5e4;
    box-shadow: 0 4px 20px -4px rgba(0,0,0,0.1);
}
.theme-forest .dle-block-title { 
    background: linear-gradient(90deg, #14532d 0%, #22c55e 50%, #84cc16 100%);
    border-radius: 0.75rem 0.75rem 0 0;
}
.theme-forest .btn-dle { 
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border-radius: 0.5rem;
}
.theme-forest header.dle-block { 
    background: rgba(245, 245, 244, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}
.theme-forest header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(245,245,244,0.9) 0%, transparent 40%, transparent 60%, rgba(245,245,244,0.9) 100%); 
}

/* Royal (Purple/Violet) - Luxury, Elegant */
body.theme-royal { 
    background: #030712;
    font-family: 'Playfair Display', serif;
    position: relative;
}
body.theme-royal::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #030712;
    background-image: radial-gradient(#f59e0b 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.1;
}
.theme-royal .dle-block { 
    background: #111827;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0;
}
.theme-royal .dle-block-title { 
    background: linear-gradient(90deg, #4c1d95 0%, #8b5cf6 50%, #f59e0b 100%);
}
.theme-royal .btn-dle { 
    background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 0 12px rgba(139,92,246,0.4);
}
.theme-royal header.dle-block { 
    background: #030712;
    border-bottom: 1px solid rgba(251, 191, 36, 0.4);
}
.theme-royal header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(3,7,18,0.9) 0%, transparent 40%, transparent 60%, rgba(3,7,18,0.9) 100%); 
}

/* Netflix (Movie Dark) */
body.theme-netflix {
    background: #000 !important;
    color: #e5e5e5 !important;
}

.theme-netflix .dle-block {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid #333;
    border-radius: 4px;
}

.theme-netflix .dle-block-title {
    background: transparent;
    border-bottom: 2px solid #e50914;
    color: #e50914;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

.theme-netflix .btn-dle {
    background: #e50914;
    border-radius: 2px;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.2s;
}

.theme-netflix .btn-dle:hover {
    background: #b20710;
}

.theme-netflix .torrent-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-netflix .torrent-card:hover {
    transform: scale(1.08) !important;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}

.theme-netflix .torrent-card img {
    border-radius: 4px 4px 0 0;
}

.theme-netflix .logo-text {
    background: linear-gradient(90deg, #fff 0%, #fff 63%, #e50914 63%, #e50914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.theme-netflix header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    border-bottom: none !important;
}

.theme-netflix .search-input {
    background: rgba(0,0,0,0.75) !important;
    border: 1px solid #333 !important;
}

.theme-netflix .search-input:focus {
    border-color: #e50914 !important;
}

/* Sunset (Warm Orange/Rose) */
body.theme-sunset { 
    background: #fff7ed;
    font-family: 'Nunito', sans-serif;
    position: relative;
}
body.theme-sunset::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, #fff7ed 0%, #fff1f2 100%);
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c2410c' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}
.theme-sunset .dle-block { 
    background: #ffffff;
    border-radius: 2rem;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(249,115,22,0.1);
}
.theme-sunset .dle-block-title { 
    background: linear-gradient(90deg, #c2410c 0%, #f97316 50%, #f43f5e 100%);
    border-radius: 2rem 2rem 0 0;
}
.theme-sunset .btn-dle { 
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    border-radius: 9999px;
    box-shadow: 0 0 20px rgba(249,115,22,0.3);
}
.theme-sunset header.dle-block { 
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid rgba(249,115,22,0.2);
}
.theme-sunset header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(255,247,237,0.9) 0%, transparent 40%, transparent 60%, rgba(255,247,237,0.9) 100%); 
}

/* Cyber (Neon Lime/Fuchsia) - Tech */
body.theme-cyber { 
    background: #030303;
    font-family: 'Share Tech Mono', monospace;
    position: relative;
}
body.theme-cyber::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #030303;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.05) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(0, 255, 0, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.theme-cyber .dle-block { 
    background: #000000;
    border: 1px solid #84cc16;
    border-radius: 0;
}
.theme-cyber .dle-block-title { 
    background: linear-gradient(90deg, #365314 0%, #84cc16 50%, #d946ef 100%);
}
.theme-cyber .btn-dle { 
    background: linear-gradient(180deg, #84cc16 0%, #65a30d 100%);
    box-shadow: 0 0 16px rgba(132,204,22,0.6), 0 0 32px rgba(132,204,22,0.3);
    border-radius: 0;
}
.theme-cyber header.dle-block { 
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid #84cc16;
}
.theme-cyber header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(3,3,3,0.95) 0%, transparent 40%, transparent 60%, rgba(3,3,3,0.95) 100%); 
}

/* Midnight (Deep Blue) - Minimalist */
body.theme-midnight { 
    background: #020617;
    font-family: 'Inter', sans-serif;
    position: relative;
}
body.theme-midnight::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at top, #1e293b 0%, #020617 100%);
    background-image: 
        radial-gradient(white, rgba(255,255,255,.1) 1px, transparent 1px),
        radial-gradient(white, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 50px 50px, 100px 100px;
    background-position: 0 0, 25px 25px;
}
.theme-midnight .dle-block { 
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.75rem;
}
.theme-midnight .dle-block:hover { 
    background: rgba(30, 41, 59, 0.5);
    border-color: #1e293b;
}
.theme-midnight .dle-block-title { 
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 50%, #0ea5e9 100%);
    border-radius: 0.75rem 0.75rem 0 0;
}
.theme-midnight .btn-dle { 
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 0 12px rgba(59,130,246,0.4);
    border-radius: 0.5rem;
}
.theme-midnight header.dle-block { 
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #1e293b;
}
.theme-midnight header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(2,6,23,0.9) 0%, transparent 40%, transparent 60%, rgba(2,6,23,0.9) 100%); 
}

/* Coffee (Cozy Brown/Amber) - Paper-like */
body.theme-coffee { 
    background: #fcf8f5;
    font-family: 'Special Elite', cursive;
    position: relative;
}
body.theme-coffee::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #fcf8f5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
}
.theme-coffee .dle-block { 
    background: #fffaf5;
    border-radius: 0;
    border: 1px solid #d6d3d1;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    transform: rotate(1deg);
    transition: transform 0.3s;
}
.theme-coffee .dle-block:hover { 
    transform: rotate(0deg);
}
.theme-coffee .dle-block-title { 
    background: linear-gradient(90deg, #92400e 0%, #f59e0b 50%, #78716c 100%);
}
.theme-coffee .btn-dle { 
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border-radius: 0.375rem;
    box-shadow: 4px 4px 0px 0px #451a03;
}
.theme-coffee header.dle-block { 
    background: #f5ebe0;
    border-bottom: 4px solid #92400e;
}
.theme-coffee header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(252,248,245,0.9) 0%, transparent 40%, transparent 60%, rgba(252,248,245,0.9) 100%); 
}

/* Mint (Fresh Teal/Emerald) */
body.theme-mint { 
    background: #f0fdfa;
    font-family: 'Outfit', sans-serif;
    position: relative;
}
body.theme-mint::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #f0fdfa;
    background-image: radial-gradient(#5eead4 2px, transparent 2px);
    background-size: 24px 24px;
}
.theme-mint .dle-block { 
    background: #ffffff;
    border-radius: 2.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.5s;
}
.theme-mint .dle-block:hover { 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: scale(1.02);
}
.theme-mint .dle-block-title { 
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 50%, #10b981 100%);
    border-radius: 2.5rem 2.5rem 0 0;
}
.theme-mint .btn-dle { 
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    box-shadow: 0 0 20px rgba(20,184,166,0.3);
    border-radius: 1.5rem;
}
.theme-mint header.dle-block { 
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.theme-mint header.has-header-decoration::after { 
    background: linear-gradient(to right, rgba(240,253,250,0.9) 0%, transparent 40%, transparent 60%, rgba(240,253,250,0.9) 100%); 
}

/* --- Настройки оформления (админка) --- */

/* Форма блоков: закруглённые / квадратные */
body.style-blocks-rounded .dle-block { border-radius: 12px; overflow: hidden; }
body.style-blocks-rounded .dle-block-title { border-radius: 12px 12px 0 0; }
body.style-blocks-square .dle-block,
body.style-blocks-square .dle-block-title { border-radius: 0; }

/* Форма кнопок */
body.style-buttons-rounded .btn-dle,
body.style-buttons-rounded nav a,
body.style-buttons-rounded .px-4.py-2.rounded { border-radius: 8px; }
body.style-buttons-square .btn-dle,
body.style-buttons-square nav a,
body.style-buttons-square .px-4.py-2.rounded { border-radius: 0; }

/* Шапка и подвал закруглить */
body.style-hf-rounded header.dle-block {
    border-radius: 0 0 16px 16px;
}
body.style-hf-rounded footer.dle-block {
    border-radius: 16px 16px 0 0;
}

/* Прозрачный фон блоков */
body.style-blocks-transparent .dle-block {
    background: rgba(51, 65, 85, 0.72);
    border-color: rgba(71, 85, 105, 0.8);
}
body.style-blocks-transparent .dle-block-title {
    background: rgba(71, 85, 105, 0.85);
    border-bottom-color: rgba(71, 85, 105, 0.6);
}

/* Неоновое свечение */
body.style-neon-glow .btn-dle {
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.55), 0 0 28px rgba(59, 130, 246, 0.25);
}
body.style-neon-glow .btn-dle:hover {
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.7), 0 0 36px rgba(59, 130, 246, 0.35);
}
body.style-neon-glow .dle-block {
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.12), inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}
body.style-neon-glow header.dle-block,
body.style-neon-glow footer.dle-block {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Подвал с декоративной картинкой */
footer.has-footer-decoration {
    min-height: 4rem;
}
footer.has-footer-decoration::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(30,41,59,0.88) 0%, transparent 38%, transparent 62%, rgba(30,41,59,0.88) 100%);
    pointer-events: none;
    z-index: 1;
}
footer.has-footer-decoration .container { position: relative; z-index: 2; }
