﻿/* ========================================
   UNIFIED MOBILE RESPONSIVE STYLES
   Colegio De Amore - Mobile First Design
   ========================================
   This file provides consistent mobile responsiveness
   across all pages of the system.
   ======================================== */

/* =========================
   Standard Breakpoints
   ========================= */
/* Mobile: ≤600px */
/* Tablet: 601px - 768px */
/* Desktop: ≥769px */

/* =========================
   Base Mobile Styles
   ========================= */
@media (max-width: 600px) {
  /* Ensure proper viewport behavior */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    background: #ffffff !important;
    background-color: #ffffff !important;
  }
  
  html {
    background: #ffffff !important;
    background-color: #ffffff !important;
  }
  
  /* Prevent horizontal scroll */
  * {
    max-width: 100%;
  }
  
  /* Images responsive */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  
  h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
  }
  
  h3 {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  }
  
  p {
    font-size: clamp(0.9rem, 3vw, 1rem);
    line-height: 1.6;
  }
}

/* =========================
   Cards - Responsive
   ========================= */
@media (max-width: 600px) {
  .card,
  .card-panel,
  .content-card {
    padding: 15px;
    margin: 10px 0;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 15px;
  }
  
  .card-title {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin: 0;
  }
}

/* =========================
   Tables - Responsive
   ========================= */
@media (max-width: 600px) {
  .table-responsive,
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
  }
  
  table {
    width: 100%;
    font-size: 0.85rem;
    min-width: 600px; /* Maintain readability */
  }
  
  table th {
    font-size: 0.8rem;
    padding: 10px 8px;
    white-space: nowrap;
  }
  
  table td {
    font-size: 0.8rem;
    padding: 10px 8px;
  }
  
  .table-striped tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
  }
}

/* =========================
   Forms - Responsive
   ========================= */
@media (max-width: 600px) {
  form {
    width: 100%;
  }
  
  .form-group,
  .form-row,
  .input-group {
    width: 100%;
    margin-bottom: 15px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="tel"],
  select,
  textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    box-sizing: border-box;
  }
  
  textarea {
    min-height: 120px;
    resize: vertical;
  }
  
  label {
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: block;
  }
}

/* =========================
   Buttons - Responsive
   ========================= */
@media (max-width: 600px) {
  .btn,
  button,
  .button,
  input[type="submit"],
  input[type="button"] {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 8px;
    min-height: 44px; /* Touch-friendly */
    margin: 5px 0;
  }
  
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    margin: 5px 0;
  }
}

/* =========================
   Grids and Layouts
   ========================= */
@media (max-width: 600px) {
  .grid,
  .grid-container,
  .row {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .col,
  .column {
    width: 100%;
    flex: 1 1 100%;
  }
  
  /* Stats Grid */
  .stats-grid,
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Action Cards */
  .action-cards,
  .card-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Two column layouts */
  .two-column,
  .split-layout {
    flex-direction: column;
  }
}

/* =========================
   Search and Filter
   ========================= */
@media (max-width: 600px) {
  .search-filter-container,
  .filter-container {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  
  .search-filter-container > *,
  .filter-container > * {
    width: 100%;
    flex: 1 1 100%;
  }
  
  .search-box {
    width: 100%;
    min-width: 100%;
  }
  
  .filter-select {
    width: 100%;
  }
}

/* =========================
   Navigation
   ========================= */
@media (max-width: 600px) {
  .nav-list,
  .navigation-list {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-item {
    width: 100%;
    padding: 12px 15px;
  }
  
  .breadcrumb {
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
}

/* =========================
   Badges and Labels
   ========================= */
@media (max-width: 600px) {
  .badge,
  .label {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
  }
  
  .badge-group {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* =========================
   Modals and Overlays
   ========================= */
@media (max-width: 600px) {
  .modal,
  .modal-dialog {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    margin: 10px;
  }
  
  .modal-content {
    padding: 20px 15px;
  }
  
  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* =========================
   Sections and Containers
   ========================= */
@media (max-width: 600px) {
  section {
    padding: 20px 15px;
    background: #ffffff;
  }
  
  .container {
    padding: 15px;
    width: 100%;
    max-width: 100%;
    background: #ffffff;
  }
  
  .container-fluid {
    padding: 15px;
    background: #ffffff;
  }
  
  .content-wrapper,
  .main-content {
    padding: 15px;
    background: #ffffff;
  }
  
  /* Ensure main content areas have white background */
  .home,
  .main-section,
  .content-section {
    background: #ffffff !important;
  }
}

/* =========================
   News and Events Cards
   ========================= */
@media (max-width: 600px) {
  .news_events-container,
  .news-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .news_events-card,
  .news-card {
    width: 100%;
  }
}

/* =========================
   Profile and User Info
   ========================= */
@media (max-width: 600px) {
  .profile-card,
  .user-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }
  
  .profile-info {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

/* =========================
   Utility Classes
   ========================= */
@media (max-width: 600px) {
  .hide-mobile {
    display: none !important;
  }
  
  .show-mobile {
    display: block !important;
  }
  
  .text-center-mobile {
    text-align: center;
  }
  
  .full-width-mobile {
    width: 100% !important;
  }
}

/* =========================
   Tablet Adjustments (601px - 768px)
   ========================= */
@media (min-width: 601px) and (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .action-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  table {
    font-size: 0.9rem;
  }
  
  .card {
    padding: 20px;
  }
}

/* =========================
   Print Styles
   ========================= */
@media print {
  .no-print,
  .hide-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

