/* BP1 Template - Responsive Design */

/* CSS Variables for responsive breakpoints */
:root {
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1200px;
  --breakpoint-2xl: 1440px;
}

/* Base responsive reset */
* {
  box-sizing: border-box;
}

/* Mobile First Approach */

/* Extra Small Devices (Portrait phones, < 576px) */
.container {
  width: 100%;
  padding: 0 16px;
  margin: 0 auto;
}

.responsive-container {
  width: 100%;
  max-width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

/* Grid System - Mobile First */
.grid {
  display: grid;
  gap: 16px;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Flexbox System */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.flex-1 {
  flex: 1;
}

.flex-auto {
  flex: auto;
}

.flex-none {
  flex: none;
}

/* Spacing Utilities */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.m-6 { margin: 24px; }
.m-8 { margin: 32px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.px-8 { padding-left: 32px; padding-right: 32px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

/* Width Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.w-1\/4 { width: 25%; }
.w-3\/4 { width: 75%; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

/* Text Utilities */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Display Utilities */
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow Utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* Small Devices (Landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    padding: 0 24px;
  }
  
  .responsive-container {
    padding: 0 1.5rem;
  }
  
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .sm\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .sm\:flex {
    display: flex;
  }
  
  .sm\:hidden {
    display: none;
  }
  
  .sm\:text-left {
    text-align: left;
  }
  
  .sm\:text-center {
    text-align: center;
  }
  
  .sm\:text-right {
    text-align: right;
  }
  
  .sm\:px-6 {
    padding-left: 24px;
    padding-right: 24px;
  }
  
  .sm\:py-8 {
    padding-top: 32px;
    padding-bottom: 32px;
  }
}

/* Medium Devices (Tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    padding: 0 32px;
    max-width: 720px;
  }
  
  .responsive-container {
    padding: 0 2rem;
    max-width: 960px;
  }
  
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .md\:grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .md\:flex {
    display: flex;
  }
  
  .md\:flex-row {
    flex-direction: row;
  }
  
  .md\:flex-col {
    flex-direction: column;
  }
  
  .md\:hidden {
    display: none;
  }
  
  .md\:block {
    display: block;
  }
  
  .md\:text-left {
    text-align: left;
  }
  
  .md\:text-center {
    text-align: center;
  }
  
  .md\:text-right {
    text-align: right;
  }
  
  .md\:px-8 {
    padding-left: 32px;
    padding-right: 32px;
  }
  
  .md\:py-12 {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  
  .md\:text-base {
    font-size: 16px;
  }
  
  .md\:text-lg {
    font-size: 18px;
  }
  
  .md\:text-xl {
    font-size: 20px;
  }
  
  .md\:text-2xl {
    font-size: 24px;
  }
  
  .md\:text-3xl {
    font-size: 30px;
  }
}

/* Large Devices (Desktops, 1024px and up) */
@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
  
  .responsive-container {
    max-width: 1200px;
  }
  
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .lg\:grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .lg\:flex {
    display: flex;
  }
  
  .lg\:hidden {
    display: none;
  }
  
  .lg\:block {
    display: block;
  }
  
  .lg\:px-12 {
    padding-left: 48px;
    padding-right: 48px;
  }
  
  .lg\:py-16 {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  
  .lg\:text-lg {
    font-size: 18px;
  }
  
  .lg\:text-xl {
    font-size: 20px;
  }
  
  .lg\:text-2xl {
    font-size: 24px;
  }
  
  .lg\:text-3xl {
    font-size: 30px;
  }
  
  .lg\:text-4xl {
    font-size: 36px;
  }
}

/* Extra Large Devices (Large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  .responsive-container {
    max-width: 1400px;
  }
  
  .xl\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .xl\:grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .xl\:flex {
    display: flex;
  }
  
  .xl\:hidden {
    display: none;
  }
  
  .xl\:block {
    display: block;
  }
}

/* Extra Extra Large Devices (Extra large desktops, 1440px and up) */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
  
  .responsive-container {
    max-width: 1600px;
  }
  
  .xxl\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .xxl\:grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .xxl\:flex {
    display: flex;
  }
  
  .xxl\:hidden {
    display: none;
  }
  
  .xxl\:block {
    display: block;
  }
}

/* Component Responsive Adjustments */

/* Header Responsive */
.header {
  padding: 1rem 0;
}

.header-nav {
  display: none;
}

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

@media (min-width: 768px) {
  .header {
    padding: 1.5rem 0;
  }
  
  .header-nav {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
}

/* Navigation Responsive */
.nav-menu {
  flex-direction: column;
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: var(--background);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1000;
}

.nav-menu.active {
  left: 0;
}

.nav-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.nav-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (min-width: 768px) {
  .nav-menu {
    flex-direction: row;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
  }
  
  .nav-menu-header,
  .nav-menu-close {
    display: none;
  }
}

/* Grid Layouts Responsive */
.news-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 576px) {
  .movies-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .movies-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .movies-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1200px) {
  .movies-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Sidebar Responsive */
.sidebar {
  order: 2;
}

.main-content {
  order: 1;
}

@media (min-width: 1024px) {
  .sidebar {
    order: 1;
    flex: 0 0 300px;
  }
  
  .main-content {
    order: 2;
    flex: 1;
  }
}

/* Footer Responsive */
.footer {
  padding: 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Player Responsive */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

@media (min-width: 768px) {
  .video-controls {
    padding: 1rem;
  }
  
  .controls-row {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Modal Responsive */
.modal-content {
  margin: 20px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
}

@media (min-width: 768px) {
  .modal-content {
    margin: 40px auto;
    max-width: 600px;
    max-height: 80vh;
  }
}

@media (min-width: 1024px) {
  .modal-content {
    max-width: 800px;
  }
}

/* Search Responsive */
.search-form {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
}

@media (min-width: 768px) {
  .search-form {
    width: auto;
    min-width: 300px;
  }
  
  .search-input {
    width: 300px;
  }
}

@media (min-width: 1024px) {
  .search-input {
    width: 400px;
  }
}

/* Breadcrumb Responsive */
.breadcrumb {
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 768px) {
  .breadcrumb {
    flex-wrap: nowrap;
  }
}

/* Pagination Responsive */
.pagination {
  flex-wrap: wrap;
  gap: 4px;
}

@media (min-width: 768px) {
  .pagination {
    gap: 8px;
  }
}

/* Table Responsive */
.table-wrapper {
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .table-wrapper {
    margin: 0;
    padding: 0;
    overflow-x: visible;
  }
}

/* Form Responsive */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
    gap: 1.5rem;
  }
  
  .form-col {
    flex: 1;
  }
}

/* Card Grid Responsive */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 576px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Alert Responsive */
.alert {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

@media (min-width: 768px) {
  .alert {
    flex-direction: row;
    align-items: center;
  }
}

/* Hero Section Responsive */
.hero {
  padding: 3rem 0;
  text-align: center;
}

.hero-title {
  font-size: 2rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .hero {
    padding: 5rem 0;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 7rem 0;
  }
  
  .hero-title {
    font-size: 4rem;
  }
}

/* Loading States Responsive */
.loading-overlay {
  padding: 2rem;
}

@media (min-width: 768px) {
  .loading-overlay {
    padding: 3rem;
  }
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  /* Larger touch targets */
  .btn,
  .btn-sm {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* More spacing */
  .section {
    margin-bottom: 2rem;
  }
  
  /* Simplified layouts */
  .complex-grid {
    grid-template-columns: 1fr;
  }
  
  /* Better text sizing */
  body {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Improved tap spacing */
  .clickable {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break-before {
    page-break-before: always;
  }
  
  .print-break-after {
    page-break-after: always;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: black;
    background: white;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .page {
    margin: 0.5in;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Higher quality images for retina displays */
  .retina-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark Mode Responsive Considerations */
@media (prefers-color-scheme: dark) {
  /* Adjustments for system dark mode if auto-theme is enabled */
  .auto-theme .card {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  /* Respect user's motion preferences */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
}

/* Tablet Portrait */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .container {
    max-width: 600px;
  }
}

/* Small Desktops */
@media (min-width: 1024px) and (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
}

/* Ultra-wide Displays */
@media (min-width: 1920px) {
  .container {
    max-width: 1800px;
  }
  
  .responsive-container {
    max-width: 2000px;
  }
}