/*
Theme Name: WiFiTest
Theme URI: https://wifitest.net/
Author: WiFiTest
Author URI: https://wifitest.net/
Description: Modern, fast, and SEO-optimized theme for WiFiTest.net. Features: multilingual support (4 languages), AdSense-ready ad zones, dark modern design with neon gradients, fully responsive, optimized for Core Web Vitals.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wifitest
Tags: multilingual, rtl-language-support, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, blog
*/

/* ============================================
   WIFITEST WORDPRESS THEME — Main Stylesheet
   Same design system as the HTML homepage
   ============================================ */

/* CSS Variables */
:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #0f1537;
  --bg-tertiary: #161d47;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-quaternary: rgba(255, 255, 255, 0.35);

  --accent-cyan: #00d4ff;
  --accent-purple: #7c3aed;
  --accent-pink: #ff2d92;
  --accent-green: #10b981;
  --accent-yellow: #fbbf24;
  --accent-red: #ef4444;

  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #ff2d92 100%);
  --gradient-secondary: linear-gradient(135deg, #7c3aed 0%, #ff2d92 100%);
  --gradient-cool: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;

  --container-max: 1200px;
  --container-padding: clamp(1rem, 4vw, 2rem);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body,
html[lang="ar"] body {
  font-family: 'Noto Sans Arabic', var(--font-body);
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--accent-pink); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol { list-style-position: inside; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  position: relative;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1em; color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 14, 39, 0.8);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.site-logo:hover { color: var(--text-primary); }

.site-logo svg {
  width: 32px;
  height: 32px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
}

.site-logo strong {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.main-nav ul {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
  color: var(--text-primary);
  background: var(--bg-card);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Polylang language switcher */
.lang-switcher {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.lang-switcher a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.lang-switcher a:hover,
.lang-switcher .current-lang a {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-default);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

/* ============================================
   PAGE & CONTENT
   ============================================ */
.site-content {
  min-height: 60vh;
  padding: 3rem 0;
}

.page-header {
  text-align: center;
  padding: 3rem 0;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.15), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.page-title {
  margin-bottom: 1rem;
}

.page-description {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Article / Post */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.post-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-default);
  transform: translateY(-4px);
}

.post-card-thumbnail {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
}

.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out);
}

.post-card:hover .post-card-thumbnail img {
  transform: scale(1.05);
}

.post-card-body {
  padding: 1.5rem;
}

.post-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-card-title a {
  color: var(--text-primary);
}

.post-card-title a:hover {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.post-card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-cyan);
}

.read-more:hover { color: var(--accent-pink); }

/* Single Post */
.single-post-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.single-post-header {
  text-align: center;
  margin-bottom: 3rem;
}

.single-post-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.single-post-title {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

.single-post-featured {
  aspect-ratio: 16 / 9;
  margin-bottom: 3rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.single-post-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.single-post-content h2 { font-size: 1.75rem; }
.single-post-content h3 { font-size: 1.4rem; }

.single-post-content p {
  margin-bottom: 1.25em;
  color: var(--text-secondary);
}

.single-post-content ul,
.single-post-content ol {
  margin: 1em 0 1.5em 1.5em;
  color: var(--text-secondary);
}

html[dir="rtl"] .single-post-content ul,
html[dir="rtl"] .single-post-content ol {
  margin: 1em 1.5em 1.5em 0;
}

.single-post-content li {
  margin-bottom: 0.5em;
}

.single-post-content img {
  border-radius: var(--radius-md);
  margin: 1.5em 0;
}

.single-post-content blockquote {
  border-left: 3px solid var(--accent-purple);
  padding: 1rem 1.5rem;
  margin: 2em 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-primary);
}

html[dir="rtl"] .single-post-content blockquote {
  border-left: none;
  border-right: 3px solid var(--accent-purple);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.single-post-content code {
  background: var(--bg-card);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-cyan);
}

.single-post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.single-post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.single-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.single-post-content th,
.single-post-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.single-post-content th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-primary);
}

html[dir="rtl"] .single-post-content th,
html[dir="rtl"] .single-post-content td {
  text-align: right;
}

.single-post-content a {
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  transition: all var(--transition-fast);
}

.single-post-content a:hover {
  color: var(--accent-pink);
  border-bottom-color: var(--accent-pink);
}

/* Post tags and categories */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}

.post-tags a {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: none;
}

.post-tags a:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* CTA Box */
.speedtest-cta {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(255, 45, 146, 0.08));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin: 3rem 0;
}

.speedtest-cta h3 {
  margin-bottom: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white !important;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
  color: white !important;
}

/* Ad zones */
.ad-zone {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-zone-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-quaternary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.pagination a,
.pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination a:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.pagination .current {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

/* Comments */
.comments-section {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.comments-title {
  margin-bottom: 1.5rem;
}

.comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.comment:last-child { border-bottom: none; }

.comment-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .main-nav.mobile-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem;
  }
  .main-nav.mobile-open ul {
    flex-direction: column;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Screen reader only */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* WordPress alignment classes */
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.alignwide { max-width: 100%; }
.alignfull { max-width: 100%; }
