/* 
   Pool Pal - Global Responsive Stylesheet
   This stylesheet provides consistent responsive behavior across all pages
*/

/* Base responsive settings */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container elements */
.container,
.card,
.box,
.panel,
.section {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Responsive grid system */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col,
[class*="col-"] {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

/* Buttons */
button,
.btn {
  cursor: pointer;
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: none;
  transition: all 0.3s ease;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

button:hover,
.btn:hover {
  opacity: 0.9;
}

/* Form elements */
input, 
select, 
textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, 
select:focus, 
textarea:focus {
  outline: none;
  border-color: #ffbf00;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Card styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Profile & photo elements */
.profile-photo, 
.avatar-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-img, 
.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Margin utilities */
.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; }
.my-1 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-2 { margin-top: 1rem; margin-bottom: 1rem; }
.my-3 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-4 { margin-top: 2rem; margin-bottom: 2rem; }

/* Padding utilities */
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Display utilities */
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Theme colors */
.bg-primary { background-color: #ffbf00; }
.text-primary { color: #ffbf00; }
.bg-light { background-color: #f9f9fb; }
.text-dark { color: #333; }
.text-muted { color: #6c757d; }

/* Navigation responsive */
@media (max-width: 992px) {
  .navbar-collapse {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    padding: 1rem;
    background-color: white;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  }
  
  .navbar-collapse.show {
    transform: translateX(0);
  }
  
  .navbar-nav {
    flex-direction: column;
  }
  
  .navbar-toggler {
    display: block;
  }
}

/* Breakpoints */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
  
  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  .col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  
  .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Mobile specific styles */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.3rem; }
  
  .container, 
  .card,
  .section {
    padding: 15px;
  }
  
  .row {
    margin-right: -10px;
    margin-left: -10px;
  }
  
  .col, [class*="col-"] {
    padding-right: 10px;
    padding-left: 10px;
  }
  
  button, .btn {
    padding: 0.7rem 1.1rem;
  }
  
  /* Fix for mobile overflow */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mobile spacing */
  .m-mb-0 { margin-bottom: 0 !important; }
  .m-mt-0 { margin-top: 0 !important; }
  .m-p-2 { padding: 0.75rem !important; }
  
  /* Mobile text */
  .m-text-center { text-align: center !important; }
  
  /* Mobile card adjustments */
  .card {
    margin-bottom: 15px;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 14px;
  }
  
  .container, 
  .card,
  .section {
    padding: 12px;
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }
  
  .profile-img, 
  .avatar {
    width: 40px;
    height: 40px;
  }
  
  button, .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  input, select, textarea {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  /* Tight spacing for very small screens */
  .xs-p-1 { padding: 0.4rem !important; }
  .xs-m-1 { margin: 0.4rem !important; }
}

/* Touch device optimizations */
@media (hover: none) {
  button, 
  a, 
  .btn, 
  .clickable, 
  [role="button"] {
    -webkit-tap-highlight-color: transparent;
  }
  
  select {
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
  }
}

/* Misc responsive fixes */
@supports (-webkit-overflow-scrolling: touch) {
  /* iOS specific styles */
  input, 
  textarea {
    font-size: 16px; /* Prevents iOS zooming on input focus */
  }
}

/* Print styles */
@media print {
  body {
    background: #fff;
  }
  
  .no-print {
    display: none !important;
  }
  
  .container, section, .card {
    break-inside: avoid;
  }
  
  a {
    text-decoration: none !important;
  }
} 