/*
Theme Name: MagisTV Premium
Description: Premium APK-style WordPress theme with advanced customization and interactive elements
Version: 1.0.0
Author: MagisTV Team
Text Domain: magistv-premium
*/

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables */
:root {
  --primary: #2563eb;
  --secondary: #f59e0b;
  --dark: #1e293b;
  --light: #f8fafc;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --vh: 1vh; /* For mobile viewport height */
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: var(--light);
  overflow-x: hidden;
  font-size: 16px; /* Base font size for mobile */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  min-height: 44px; /* Touch-friendly links */
  display: inline-flex;
  align-items: center;
}

a:hover {
  color: var(--secondary);
}

/* Container */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 44px; /* Touch-friendly buttons */
  min-width: 44px;
  font-size: 16px; /* Prevent zoom on iOS */
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* Glass Morphism Effect */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-light);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-fade-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.py-1 { padding: 0.5rem 0; }
.py-2 { padding: 1rem 0; }
.py-3 { padding: 1.5rem 0; }
.py-4 { padding: 2rem 0; }

.px-1 { padding: 0 0.5rem; }
.px-2 { padding: 0 1rem; }
.px-3 { padding: 0 1.5rem; }
.px-4 { padding: 0 2rem; }

/* Grid System */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ===== MOBILE OPTIMIZATION ===== */

/* Tablet */
@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  
  .container {
    padding: 0 2rem;
  }
  
  /* Header adjustments for tablet */
  .site-header {
    padding: 0.75rem 0;
  }
  
  .hero-title {
    font-size: 3rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  /* Base mobile styles */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  .container {
    padding: 0 1rem;
    max-width: 100%;
  }
  
  /* Typography for mobile */
  h1 { font-size: 2rem; line-height: 1.3; }
  h2 { font-size: 1.75rem; line-height: 1.3; }
  h3 { font-size: 1.5rem; line-height: 1.3; }
  h4 { font-size: 1.25rem; }
  h5 { font-size: 1.1rem; }
  h6 { font-size: 1rem; }
  
  /* Single column layout for mobile */
  .grid-2,
  .grid-3,
  .grid-4 { 
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Touch-friendly elements */
  .btn, button, .social-link {
    min-height: 44px;
    min-width: 44px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Header mobile styles */
  .site-header {
    padding: 0.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
  }
  
  .header-content {
    padding: 0 1rem;
  }
  
  /* Hero section mobile optimization */
  .hero-section {
    min-height: calc(var(--vh, 1vh) * 100);
    padding-top: 80px; /* Account for fixed header */
  }
  
  .hero-title {
    font-size: 2.25rem;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Navigation mobile */
  .main-navigation {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
  }
  
  .hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--dark);
    margin: 3px 0;
    transition: var(--transition);
  }
  
  /* Feature cards mobile */
  .feature-card {
    padding: 1.5rem;
    text-align: center;
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
  }
  
  /* Blog cards mobile */
  .blog-card {
    margin-bottom: 1.5rem;
  }
  
  .blog-card-content {
    padding: 1rem;
  }
  
  /* Forms mobile optimization */
  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
    width: 100%;
  }
  
  /* Footer mobile */
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .footer-separator {
    display: none;
  }
  
  /* Hide desktop elements */
  .desktop-only {
    display: none !important;
  }
  
  /* Show mobile elements */
  .mobile-only {
    display: block !important;
  }
}

/* Small Mobile (iPhone SE etc) */
@media (max-width: 374px) {
  .container {
    padding: 0 0.75rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 14px;
  }
}

/* ===== HOMEPAGE FIXES ===== */
.home .container,
.page .container {
  max-width: 95%;
  margin: 0 auto;
}

/* WordPress content area alignment */
.entry-content,
.page-content {
  text-align: left;
  max-width: 100%;
}

/* Images alignment */
.wp-block-image,
.alignleft {
  float: left;
  margin: 0 20px 20px 0;
  max-width: 100%;
}

.alignright {
  float: right;
  margin: 0 0 20px 20px;
  max-width: 100%;
}

.aligncenter {
  display: block;
  margin: 0 auto 20px;
  max-width: 100%;
}

/* Mobile menu styles */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: var(--light);
  z-index: 9999;
  transition: var(--transition);
  padding: 80px 2rem 2rem;
  overflow-y: auto;
}

.mobile-menu.active {
  left: 0;
}

.mobile-nav-menu {
  list-style: none;
}

.mobile-nav-menu li {
  margin-bottom: 1rem;
}

.mobile-nav-menu a {
  display: block;
  padding: 1rem;
  background: var(--glass-bg);
  border-radius: var(--border-radius);
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.mobile-nav-menu a:hover {
  background: var(--primary);
  color: white;
}

/* Performance optimization for mobile */
@media (max-width: 767px) {
  .glass {
    backdrop-filter: blur(5px); /* Reduce blur on mobile for performance */
  }
  
  .animate-fade-up,
  .animate-slide-right {
    animation-duration: 0.4s; /* Faster animations on mobile */
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}