/*
Theme Name:   Castle APK Theme
Author:       Muhammad Hilal
Version:      1.0
Description:  A custom WordPress theme for Castle APK website.
*/

:root {
  --primary: #e50914;
  --dark:    #0f0f0f;
  --gray:    #1a1a1a;
  --muted:   #999;
  --light:   #e5e5e5;
}

/* ──────────────────────────────────────────────────────────────
   Reset & Base
────────────────────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--dark);
  color: #fff;
  line-height: 1.6;
}

/* ──────────────────────────────────────────────────────────────
   Layout & Structure
────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  padding-top: 110px;       /* Enough space for fixed header */
  margin-bottom: 80px;      /* Good breathing room before footer */
}

/* ──────────────────────────────────────────────────────────────
   Header
────────────────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #222;
  z-index: 1000;
  padding: 16px 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  font-size: 1.9rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
}

.btn {
  background: var(--primary);
  color: white;
  padding: 10px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn:hover {
  background: #b20710;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

/* ──────────────────────────────────────────────────────────────
   Hero Section
────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(rgba(0,0,0,0.82), rgba(0,0,0,0.9)),
              url('https://images.unsplash.com/photo-1594908900588-1dd3d3b8c3a0?w=1920');
  background-size: cover;
  background-position: center;
  text-align: center;
  padding: 140px 20px 100px;
}

.hero h1 {
  font-size: 3.6rem;
  margin-bottom: 1.2rem;
}

.hero p {
  font-size: 1.45rem;
  max-width: 820px;
  margin: 0 auto 2.2rem;
  color: #ddd;
}

.big-btn {
  padding: 18px 50px;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

/* ──────────────────────────────────────────────────────────────
   Sections & Components
────────────────────────────────────────────────────────────── */
section {
  padding: 90px 0;
}

h2 {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 60px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background: #111;
  padding: 32px 24px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #222;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 1.65rem;
}

.screenshots-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 50px;
}

.screenshots-grid img {
  max-width: 320px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.75);
  border: 2px solid #222;
  transition: transform 0.3s;
}

.screenshots-grid img:hover {
  transform: scale(1.04);
}

.install ol {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.25rem;
  padding-left: 36px;
}

/* ──────────────────────────────────────────────────────────────
   Footer
────────────────────────────────────────────────────────────── */
footer {
  background: #000;
  padding: 80px 0 50px;
  text-align: center;
  border-top: 1px solid #222;
  color: #888;
  font-size: 0.95rem;
}

footer a {
  color: #ccc;
  text-decoration: none;
  margin: 0 14px;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--primary);
}

/* ──────────────────────────────────────────────────────────────
   Content Pages & Sidebar Layout
────────────────────────────────────────────────────────────── */
.content-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 40px;
}

.main-content {
  flex: 3;
  min-width: 0;
}

.sidebar {
  flex: 1;
  min-width: 280px;
}

.content-area {
  padding: 50px 0;
}

.content-area h1 {
  font-size: 2.8rem;
  margin-bottom: 24px;
}

/* ──────────────────────────────────────────────────────────────
   Widgets
────────────────────────────────────────────────────────────── */
.widget {
  background: #111;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 35px;
  border: 1px solid #222;
}

.widgettitle {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 1.45rem;
}

.widget ul {
  list-style: none;
}

.widget ul li {
  margin-bottom: 12px;
}

.widget a {
  color: #ddd;
  text-decoration: none;
}

.widget a:hover {
  color: var(--primary);
}

/* ──────────────────────────────────────────────────────────────
   Archive / Blog Grid
────────────────────────────────────────────────────────────── */
.archive-header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid #222;
  margin-bottom: 50px;
}

.archive-title {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.posts-grid article {
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.posts-grid article:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
}

.read-more {
  color: var(--primary);
  font-weight: bold;
}

.read-more:hover {
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────
   Responsive
────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .content-wrapper {
    flex-direction: column;
  }
  .sidebar {
    order: 2;
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.6rem; }
  .hero p  { font-size: 1.25rem; }
  h2       { font-size: 2.3rem; }
  .screenshots-grid {
    flex-direction: column;
    align-items: center;
  }
}


.error-404-container {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

.signal-lost {
    margin: 20px;
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 12 / 9;
    background: #000;
    border: 12px solid #111;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 0 60px rgba(229,9,20,0.15),
        inset 0 0 120px rgba(0,0,0,0.9);
}

.tv-static {
    position: absolute;
    inset: 0;
    background: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.12"/></svg>'),
        linear-gradient(45deg, #0a0a0a 25%, #111 25%, #111 50%, #0a0a0a 50%);
    background-size: 200% 200%, cover;
    animation: static 8s steps(20) infinite;
    opacity: 0.6;
    mix-blend-mode: screen;
}

.content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.85) 60%);
    text-align: center;
    z-index: 2;
}

.error-code {
    font-family: 'Impact', sans-serif;
    font-size: clamp(6rem, 15vw, 14rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.05em;
    color: transparent;
    background: linear-gradient(90deg, #e50914, #ff3333, #e50914);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    animation: glitch-text 4s linear infinite;
}

h1 {
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    margin: 0.4em 0 0.6em;
    color: #fff;
    text-shadow: 0 4px 20px rgba(229,9,20,0.4);
}

.message {
    font-size: 1.35rem;
    color: #ccc;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.5;
}

.buttons {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 14px 40px;
    font-size: 1.15rem;
    font-weight: bold;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-home {
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 24px rgba(229,9,20,0.35);
}

.btn-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(229,9,20,0.5);
}

.btn-download {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

/* Animations */
@keyframes static {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

@keyframes glitch-text {
    0%, 100% { background-position: 0% 50%; }
    20%  { background-position: 100% 50%; }
    40%  { background-position: -50% 50%; }
    60%  { background-position: 150% 50%; }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .signal-lost {
        border-width: 8px;
        border-radius: 12px;
    }
    
    .error-code {
        font-size: 6rem;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    .buttons {
        flex-direction: column;
        gap: 18px;
    }
}

