:root {
  --bg-color: #0f172a;
  --bg-gradient: linear-gradient(to bottom, #020617, #0f172a);
  --surface-color: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #0ea5e9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  background-color: var(--bg-color);
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5 {
  line-height: 1.2;
}

/* Header */
header {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 1rem 2rem;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent-color));
  -webkit-background-clip: text;
  color: transparent;
}

.nav-links {
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

/* App Container */
main {
  min-height: calc(100vh - 80px);
}



.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--surface-color);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%),
                #020617;
    margin: 0;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.03)"/></svg>');
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    animation: fadeInUp 0.8s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.hero-stats {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

/* Standard Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}


.mobile-only {
    display: none;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active {
    transform: translateX(0);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mobile-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-nav-links a:hover, .mobile-nav-links a.active {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    body > #app { padding: 0; }
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    header { padding: 0.8rem 1rem; }
    .header-main { gap: 1rem !important; }
    .hero { min-height: 85vh; padding: 2rem 1rem; }
    .hero h1 { font-size: 2.4rem !important; }
    .hero p { font-size: 1rem !important; }
    .hero-cta { flex-direction: column; gap: 0.75rem; width: 100%; }
    .hero-cta .btn { width: 100%; justify-content: center; }
    .hero-stats { gap: 1.5rem !important; margin-top: 3rem !important; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    .section { padding: 3rem 0; }
}

.category-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1rem;
    text-align: left;
    text-decoration: none;
}

.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.3);
}

.category-card img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(1.2);
  transition: transform 0.3s;
}

.category-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.7) saturate(1.2);
}

.category-card h3 {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.category-card span {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 1;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Grid & Masonry */
.masonry-grid {
  column-count: var(--cols, 4);
  column-gap: 16px;
}

@media (max-width: 1200px) {
  .masonry-grid { column-count: 3 !important; }
}
/* Tablet View */
@media (max-width: 900px) {
  .masonry-grid { column-count: 2 !important; column-gap: 12px; }
}
/* Mobile View */
@media (max-width: 600px) {
  .masonry-grid { column-count: 2 !important; column-gap: 10px; }
  .hero h1 { font-size: 2.5rem; }
}

/* Wallpaper Cards Flashy Hover */
.wallpaper-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: block;
    background: var(--surface-light);
    transition: all 0.3s ease;
    cursor: zoom-in;
    break-inside: avoid;
}

.wallpaper-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px transparent;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.wallpaper-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.wallpaper-card:hover::after {
    box-shadow: inset 0 0 0 2px var(--accent-color);
}

.wallpaper-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.wallpaper-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
}

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

.wallpaper-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.wallpaper-card:hover .overlay {
  opacity: 1;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.category-card {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 0 0 auto;
}

.category-card img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(1.2);
  transition: transform 0.3s;
}

.category-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.7) saturate(1.2);
}

.category-card h3 {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.category-card span {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 1;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
}

/* Single Wallpaper Page */
.single-wp-container {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 3rem;
  padding: 2rem 0;
}

.download-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .download-buttons-container {
    flex-direction: row;
  }
}

/* Mobile: sidebar first (title/meta above image) */
@media (max-width: 1024px) {
  .single-wp-container {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "preview";
  }
  .wp-preview { grid-area: preview; }
  .wp-sidebar { grid-area: sidebar; }
}

.wp-preview {
  background: var(--surface-color);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.wp-preview img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: block;
}

.wp-sidebar {
  padding: 2rem;
  background: var(--surface-color);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wp-sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.wp-sidebar .meta {
  display: flex;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.faq-item {
  margin-bottom: 1rem;
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  border-radius: 8px;
}
.faq-item h4 { margin-bottom: 0.5rem; color: var(--accent-color); }
.faq-item p { font-size: 0.9rem; color: var(--text-secondary); }

/* Footer mobile */
@media (max-width: 768px) {
  footer > div { grid-template-columns: 1fr !important; }
  .footer-links { flex-direction: column; gap: 0.5rem; }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}
.breadcrumb a:hover { opacity: 0.8; }
.breadcrumb-sep { opacity: 0.4; }

.page-content {
  max-width: 800px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--surface-color);
  border-radius: 16px;
}
.page-content h1 { margin-bottom: 2rem; }
.page-content h2 { margin-top: 2rem; margin-bottom: 1rem; color: #f8fafc; font-size: 1.5rem; }
.page-content h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; color: #f8fafc; font-size: 1.25rem; }
.page-content p { margin-bottom: 1.2rem; line-height: 1.8; }
.page-content ul { margin-left: 1.5rem; margin-bottom: 1.2rem; list-style-type: disc; }
.page-content li { margin-bottom: 0.5rem; }

/* Cookie Banner — compact, bottom-left */
.cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: auto;
    transform: none;
    width: auto;
    max-width: 380px;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.cookie-content h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.cookie-content p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.cookie-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Telegram Banner — clean pill on mobile */
#telegram-banner {
    border-radius: 12px;
    margin: 16px auto;
    width: calc(100% - 2rem);
    max-width: 1400px;
}

@media (max-width: 768px) {
    .cookie-banner {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
    .single-wp-container {
        gap: 1rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    #telegram-banner {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
        margin: 10px auto;
        width: calc(100% - 2rem);
    }
    #telegram-banner > div:first-child {
        flex: 1;
        min-width: 0;
    }
    #telegram-banner span[style*="font-weight"] {
        font-size: 0.9rem !important;
    }
    #telegram-banner > div:last-child {
        flex-shrink: 0;
        gap: 8px;
    }
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(2, 6, 23, 0.95);
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  z-index: 1001;
  padding: 0.5rem 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dropdown-content::-webkit-scrollbar {
  width: 6px;
}
.dropdown-content::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.2);
  border-radius: 6px;
}

.dropdown-content a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.95rem;
  transition: background 0.2s;
  white-space: nowrap;
}

.dropdown-content a:hover {
  background-color: rgba(255,255,255,0.1);
  color: var(--accent-color);
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.share-buttons-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Fix mobile padding and overflow */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    width: 100vw;
  }
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    overflow-x: hidden;
  }
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .hero {
    padding: 4rem 1.5rem;
  }
  .page-content {
    margin: 2rem 1rem;
    width: calc(100% - 2rem);
    padding: 1rem;
  }
}
