/*
Theme Name: TweenZ
Description: A modern, bilingual WordPress theme designed specifically for teenagers in UAE and Egypt. Supports Arabic RTL and English with Islamic values-aligned content and teen-friendly design.
Author: TweenZ Team
Version: 1.0.0
Text Domain: tweenz
Domain Path: /languages
Tags: blog, two-columns, right-sidebar, custom-background, custom-colors, custom-header, custom-menu, featured-images, flexible-header, full-width-template, post-formats, rtl-language-support, theme-options, translation-ready
Requires at least: 5.0
Tested up to: 6.3
Requires PHP: 7.4
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   TweenZ Theme Styles
   ========================================================================== */

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

/* Root Variables for TweenZ Brand Colors */
:root {
  --tweenz-navy: #1e3a8a;
  --tweenz-blue: #3b82f6;
  --tweenz-green: #10b981;
  --tweenz-orange: #f97316;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* Typography */
body {
  font-family: 'Inter', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--gray-700);
  background-color: var(--gray-50);
}

/* Arabic RTL Support */
html[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
  direction: rtl;
}

.rtl-text {
  direction: rtl;
  text-align: right;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', 'Noto Sans Arabic', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tweenz-navy);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

/* Links */
a {
  color: var(--tweenz-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover, a:focus {
  color: var(--tweenz-navy);
  text-decoration: underline;
}

/* Container & Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
}

/* Header Styles */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo {
  width: 50px;
  height: 50px;
  background: var(--tweenz-navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.site-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tweenz-navy);
  margin: 0;
}

.site-tagline {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

/* Navigation */
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--tweenz-navy);
  border-bottom-color: var(--tweenz-green);
  text-decoration: none;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  gap: 0.5rem;
  margin-left: 2rem;
  padding-left: 2rem;
  border-left: 1px solid var(--gray-300);
}

[dir="rtl"] .language-switcher {
  margin-right: 2rem;
  margin-left: 0;
  padding-right: 2rem;
  padding-left: 0;
  border-right: 1px solid var(--gray-300);
  border-left: none;
}

.lang-link {
  padding: 0.5rem 1rem;
  background: var(--tweenz-navy);
  color: var(--white);
  border-radius: 1.5rem;
  font-size: 0.875rem;
  transition: background 0.3s ease;
}

.lang-link:hover {
  background: var(--tweenz-blue);
  color: var(--white);
  text-decoration: none;
}

/* Mobile Navigation */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--tweenz-navy);
  cursor: pointer;
}

@media (max-width: 768px) {
  .main-navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
  }

  .main-navigation.active {
    display: block;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0;
  }

  .main-navigation li {
    border-bottom: 1px solid var(--gray-100);
  }

  .main-navigation a {
    display: block;
    padding: 1rem 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .language-switcher {
    margin: 1rem 0 0 0;
    padding: 1rem 0 0 0;
    border-left: none;
    border-top: 1px solid var(--gray-300);
  }
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--tweenz-navy) 0%, var(--tweenz-blue) 100%);
  color: var(--white);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  opacity: 0.1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--white);
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 2rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--tweenz-green);
  color: var(--white);
  border-color: var(--tweenz-green);
}

.btn-primary:hover {
  background: #059669;
  border-color: #059669;
  color: var(--white);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-secondary:hover {
  background: var(--white);
  color: var(--tweenz-navy);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--tweenz-blue);
  border-color: var(--tweenz-blue);
}

.btn-outline:hover {
  background: var(--tweenz-blue);
  color: var(--white);
  text-decoration: none;
}

/* Content Sections */
.content-section {
  padding: 4rem 0;
}

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

.section-title {
  font-size: 2.5rem;
  color: var(--tweenz-navy);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

/* Feature Cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid var(--gray-100);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--tweenz-blue);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
  color: var(--white);
}

.feature-icon.wellbeing { background: var(--tweenz-green); }
.feature-icon.faith { background: var(--tweenz-navy); }
.feature-icon.community { background: var(--tweenz-blue); }

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tweenz-navy);
  margin-bottom: 1rem;
}

.feature-description {
  color: var(--gray-600);
  line-height: 1.6;
}

/* Blog Posts */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.post-card {
  background: var(--white);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.post-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--tweenz-blue), var(--tweenz-green));
}

.post-content {
  padding: 1.5rem;
}

.post-category {
  display: inline-block;
  background: var(--tweenz-green);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.post-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tweenz-navy);
  margin-bottom: 0.75rem;
}

.post-title a {
  color: inherit;
}

.post-title a:hover {
  color: var(--tweenz-blue);
  text-decoration: none;
}

.post-excerpt {
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.post-author {
  font-weight: 500;
}

.post-date {
  color: var(--gray-400);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--tweenz-navy);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--tweenz-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

[dir="rtl"] .form-input,
[dir="rtl"] .form-textarea,
[dir="rtl"] .form-select {
  text-align: right;
}

/* Newsletter Section */
.newsletter-section {
  background: var(--gray-100);
  padding: 4rem 0;
}

.newsletter-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .newsletter-form {
    flex-direction: column;
  }
}

/* Footer */
.site-footer {
  background: var(--tweenz-navy);
  color: var(--white);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

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

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #cbd5e1;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--tweenz-green);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid #475569;
  padding-top: 2rem;
  text-align: center;
  color: #cbd5e1;
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--tweenz-green);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-2px);
}

/* Chatbot */
.chatbot-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

[dir="rtl"] .chatbot-container {
  right: auto;
  left: 2rem;
}

.chatbot-toggle {
  width: 4rem;
  height: 4rem;
  background: var(--tweenz-green);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.3s ease;
}

.chatbot-toggle:hover {
  background: #059669;
  transform: scale(1.1);
}

.chatbot-window {
  position: absolute;
  bottom: 5rem;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  display: none;
}

[dir="rtl"] .chatbot-window {
  right: auto;
  left: 0;
}

.chatbot-header {
  background: linear-gradient(135deg, var(--tweenz-navy), var(--tweenz-blue));
  color: var(--white);
  padding: 1rem;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
}

.chatbot-body {
  padding: 1rem;
  max-height: 280px;
  overflow-y: auto;
}

.chat-message {
  background: var(--gray-100);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chat-option {
  background: var(--tweenz-blue);
  color: var(--white);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.chat-option:hover {
  background: var(--tweenz-navy);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .chatbot-container {
    bottom: 1rem;
    right: 1rem;
  }
  
  [dir="rtl"] .chatbot-container {
    right: auto;
    left: 1rem;
  }
  
  .chatbot-window {
    width: calc(100vw - 2rem);
    right: -1rem;
  }
  
  [dir="rtl"] .chatbot-window {
    right: auto;
    left: -1rem;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus states */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--tweenz-blue);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .hero-section {
    background: var(--tweenz-navy);
  }
  
  .feature-card {
    border: 2px solid var(--gray-900);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .site-header,
  .chatbot-container,
  .newsletter-section,
  .site-footer {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
}