/**
 * Universal Page Template Dark Theme
 * Extracted from page.php inline <style> block
 *
 * @package Teleworld_AI_Theme
 * @since 1.1.0
 */

/* ============================================================
   Universal Dark Theme Styles for All Pages
   ============================================================ */

/* ---------- Page Wrapper ---------- */
.teleworld-page-wrapper {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 60px);
  padding-bottom: 60px;
  position: relative;
}

.teleworld-page-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(139, 92, 246, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* ---------- Container ---------- */
.teleworld-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ---------- Article Card ---------- */
.teleworld-page-article {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

/* ---------- Page Header ---------- */
.teleworld-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.teleworld-page-title {
  color: #e2e8f0;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

/* ---------- Featured Image ---------- */
.teleworld-page-featured-image {
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.teleworld-page-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Content Typography ---------- */
.teleworld-page-content {
  color: #cbd5e1;
  font-size: 1.125rem;
  line-height: 1.8;
}

.teleworld-page-content h1,
.teleworld-page-content h2,
.teleworld-page-content h3,
.teleworld-page-content h4,
.teleworld-page-content h5,
.teleworld-page-content h6 {
  color: #e2e8f0;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.teleworld-page-content h2 {
  font-size: 2rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
  padding-bottom: 0.5rem;
}

.teleworld-page-content h3 {
  font-size: 1.5rem;
  color: #a78bfa;
}

.teleworld-page-content p {
  margin-bottom: 1.5rem;
}

.teleworld-page-content a {
  color: #a78bfa;
  text-decoration: none;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

.teleworld-page-content a:hover {
  color: #c4b5fd;
  border-bottom-color: #a78bfa;
}

.teleworld-page-content ul,
.teleworld-page-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.teleworld-page-content li {
  margin-bottom: 0.5rem;
  color: #cbd5e1;
}

.teleworld-page-content blockquote {
  border-left: 4px solid #8b5cf6;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  color: #94a3b8;
  font-style: italic;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
}

.teleworld-page-content code {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.9em;
}

.teleworld-page-content pre {
  background: #1e293b;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.teleworld-page-content pre code {
  background: none;
  padding: 0;
}

.teleworld-page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.teleworld-page-content th,
.teleworld-page-content td {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
  text-align: left;
}

.teleworld-page-content th {
  background: rgba(139, 92, 246, 0.2);
  color: #e2e8f0;
  font-weight: 600;
}

.teleworld-page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

/* ---------- Page Links (Pagination) ---------- */
.teleworld-page-links {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.teleworld-page-links span {
  background: rgba(139, 92, 246, 0.2);
  color: #e2e8f0;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.teleworld-page-links a span {
  cursor: pointer;
}

.teleworld-page-links a span:hover {
  background: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.teleworld-page-links .page-links-title {
  color: #a78bfa;
  font-weight: 600;
}

/* ---------- Page Footer (Edit Link) ---------- */
.teleworld-page-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  text-align: right;
}

.teleworld-page-edit-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.teleworld-page-edit-link a:hover {
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  transform: translateY(-2px);
}

/* ---------- No Content / 404 ---------- */
.teleworld-no-content {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.teleworld-no-content h1 {
  color: #e2e8f0;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.teleworld-no-content p {
  color: #94a3b8;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.teleworld-no-content a {
  display: inline-block;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.teleworld-no-content a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

/* ============================================================
   Responsive Design
   ============================================================ */

/* ---------- 1024px ---------- */
@media (max-width: 1024px) {
  .teleworld-page-wrapper {
    padding-top: calc(var(--header-height) + 48px);
    padding-bottom: 50px;
  }

  .teleworld-page-article {
    padding: 2.5rem;
  }

  .teleworld-page-title {
    font-size: 2.2rem;
  }

  .teleworld-page-content h2 {
    font-size: 1.75rem;
  }

  .teleworld-page-content h3 {
    font-size: 1.35rem;
  }

  .teleworld-page-content {
    font-size: 1.05rem;
  }

  .teleworld-no-content h1 {
    font-size: 2.2rem;
  }
}

/* ---------- 768px ---------- */
@media (max-width: 768px) {
  .teleworld-page-wrapper {
    padding-top: calc(var(--header-height) + 38px);
    padding-bottom: 40px;
  }

  .teleworld-page-container {
    padding: 0 1rem;
  }

  .teleworld-page-article {
    padding: 1.75rem;
    border-radius: 12px;
  }

  .teleworld-page-title {
    font-size: 1.85rem;
  }

  .teleworld-page-content {
    font-size: 1rem;
  }

  .teleworld-page-content h2 {
    font-size: 1.5rem;
  }

  .teleworld-page-content h3 {
    font-size: 1.25rem;
  }

  .teleworld-page-content pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .teleworld-page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .teleworld-no-content {
    padding: 3rem 1.5rem;
  }

  .teleworld-no-content h1 {
    font-size: 1.85rem;
  }
}

/* ---------- 480px ---------- */
@media (max-width: 480px) {
  .teleworld-page-wrapper {
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 30px;
  }

  .teleworld-page-container {
    padding: 0 0.75rem;
  }

  .teleworld-page-article {
    padding: 1.25rem;
    border-radius: 10px;
  }

  .teleworld-page-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  .teleworld-page-title {
    font-size: 1.55rem;
  }

  .teleworld-page-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .teleworld-page-content h2 {
    font-size: 1.3rem;
  }

  .teleworld-page-content h3 {
    font-size: 1.15rem;
  }

  .teleworld-page-content blockquote {
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
  }

  .teleworld-page-content pre {
    padding: 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .teleworld-page-content th,
  .teleworld-page-content td {
    padding: 0.5rem 0.65rem;
    font-size: 0.88rem;
  }

  .teleworld-page-links span {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .teleworld-page-footer {
    text-align: center;
  }

  .teleworld-no-content {
    padding: 2.5rem 1rem;
  }

  .teleworld-no-content h1 {
    font-size: 1.5rem;
  }

  .teleworld-no-content p {
    font-size: 1rem;
  }
}

/* ---------- 360px ---------- */
@media (max-width: 360px) {
  .teleworld-page-wrapper {
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: 25px;
  }

  .teleworld-page-article {
    padding: 1rem;
  }

  .teleworld-page-title {
    font-size: 1.35rem;
  }

  .teleworld-page-content {
    font-size: 0.9rem;
  }

  .teleworld-page-content h2 {
    font-size: 1.2rem;
  }

  .teleworld-page-content h3 {
    font-size: 1.05rem;
  }
}

/* ---------- Landscape ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  .teleworld-page-wrapper {
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 30px;
  }

  .teleworld-page-article {
    padding: 1.5rem;
  }

  .teleworld-page-title {
    font-size: 1.75rem;
  }
}

/* ---------- Safe-area insets (notched devices) ---------- */
@supports (padding: env(safe-area-inset-left)) {
  .teleworld-page-container {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }

  @media (max-width: 480px) {
    .teleworld-page-container {
      padding-left: max(0.75rem, env(safe-area-inset-left));
      padding-right: max(0.75rem, env(safe-area-inset-right));
    }
  }
}

/* ---------- Print ---------- */
@media print {
  .teleworld-page-wrapper {
    background: #fff !important;
    padding-top: 0;
    padding-bottom: 0;
    min-height: auto;
  }

  .teleworld-page-wrapper::before {
    display: none;
  }

  .teleworld-page-article {
    background: none;
    border: 1px solid #ccc;
    box-shadow: none;
    backdrop-filter: none;
    padding: 1.5rem;
  }

  .teleworld-page-title {
    background: none;
    -webkit-text-fill-color: #1e293b;
    color: #1e293b;
  }

  .teleworld-page-content,
  .teleworld-page-content p,
  .teleworld-page-content li {
    color: #1e293b;
  }

  .teleworld-page-content a {
    color: #6d28d9;
    border-bottom: none;
  }

  .teleworld-page-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #64748b;
  }

  .teleworld-page-edit-link,
  .teleworld-no-content a {
    display: none !important;
  }
}
