/*
Theme Name: Media V2
Theme URI: https://example.com
Description: A high-performance WordPress media platform theme. Three-column grid discovery feed + immersive vertical swipe consumption. SEO-optimized, CDN-friendly, engineered for 100k+ DAU.
Author: Media V2
Author URI: https://example.com
Version: 2.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: videoswipe-standalone
Domain Path: /languages
Requires at least: 5.9
Requires PHP: 8.1
*/

/* ============================================
   Media V2 — Main Stylesheet
   High-performance media platform
   ============================================ */

:root {
  /* Color Palette */
  --primary: #ff0050;
  --secondary: #25f4ee;
  --dark-bg: #0a0a0a;
  --dark-secondary: #1a1a1a;
  --dark-tertiary: #262626;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --border-color: #262626;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--dark-bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

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

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--secondary);
}

/* Buttons */
button,
.btn,
input[type="button"],
input[type="submit"] {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  background-color: var(--primary);
  color: var(--text-primary);
}

button:hover,
.btn:hover {
  background-color: #ff1a5e;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--dark-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  margin-bottom: 1rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 0, 80, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

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

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.grid { display: grid; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.hidden { display: none; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  body { font-size: 14px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1rem; }
  h3 { font-size: 0.95rem; }
}

/* 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-width: 0;
}

a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* ============================================
   Header & Footer
   ============================================ */

.videoswipe-header {
  background: var(--dark-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.videoswipe-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.videoswipe-site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.videoswipe-nav {
  flex: 1;
}

.videoswipe-nav-menu,
.videoswipe-nav ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.videoswipe-nav a {
  color: var(--text-primary);
}

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

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

.videoswipe-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--dark-tertiary);
  border-radius: var(--radius-full);
  padding: 0 0.5rem 0 0.75rem;
}

.videoswipe-search-form input[type="search"] {
  background: transparent;
  border: none;
  padding: 0.5rem;
  margin: 0;
  color: var(--text-primary);
  width: 180px;
}

.videoswipe-search-form input[type="search"]:focus {
  outline: none;
  box-shadow: none;
}

.videoswipe-search-form button {
  background: transparent;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-full);
}

.videoswipe-search-form button:hover {
  background: var(--primary);
  transform: none;
  box-shadow: none;
}

.videoswipe-user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.videoswipe-user-link img {
  border-radius: 50%;
}

.videoswipe-logout-link,
.videoswipe-login-btn {
  font-size: 0.85rem;
}

.videoswipe-logout-link {
  color: var(--text-secondary);
}

.videoswipe-footer {
  background: var(--dark-secondary);
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

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

.videoswipe-footer-section h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.videoswipe-footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.videoswipe-footer-section li {
  margin-bottom: 0.4rem;
}

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

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

.videoswipe-social-links {
  display: flex;
  gap: 0.75rem;
}

.videoswipe-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dark-tertiary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.videoswipe-social-link:hover {
  background: var(--primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.videoswipe-footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.videoswipe-footer-bottom p {
  margin: 0.2rem 0;
  color: inherit;
}

/* Header / search on mobile */
@media (max-width: 768px) {
  .videoswipe-header-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .videoswipe-nav {
    order: 3;
    flex-basis: 100%;
  }
  .videoswipe-search-form input[type="search"] {
    width: 120px;
  }
}
