/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablets */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .logo {
    font-size: 2rem;
  }

  .logo-img {
    width: 65px;
    height: 65px;
  }

  .nav-container {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
  }

  .calendar-day {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .calendar-day-number {
    font-size: 0.85rem;
  }

  .calendar-day-routines {
    gap: 0.15rem;
    font-size: 0.65rem;
  }

  .monthly-routine-item {
    padding: 0.25rem 0.35rem;
  }

  .monthly-routine-name {
    font-size: 0.6rem;
  }

  .monthly-routine-blocks {
    font-size: 0.55rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .exercise-field {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
  }

  .exercise-field input {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .rep-type-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .weights-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.3rem;
  }

  .exercise-field .exercise-remove {
    padding: 0.5rem;
    align-self: flex-end;
  }

  .modal-content {
    width: 90%;
    max-height: 95vh;
  }

  .modal-large {
    max-width: 90%;
  }

  .modal-xlarge {
    max-width: 95%;
  }

  .color-picker-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .schedule-grid {
    grid-template-columns: 60px 1fr;
    gap: 0.25rem;
  }

  .schedule-time-slot,
  .schedule-block {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  .detail-block-actions {
    grid-template-columns: 1fr;
  }

  .detail-day-section {
    padding: 1rem;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .template-actions {
    flex-direction: column;
  }

  .template-actions button {
    width: 100%;
  }
}

/* Mobile Phones */
@media (max-width: 480px) {
  body {
    font-size: 0.95rem;
  }

  header.header {
    padding: 1rem 0.5rem;
  }

  .header-content {
    flex-direction: column;
    gap: 0.25rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .logo-img {
    width: 55px;
    height: 55px;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  nav.navbar {
    padding: 0.75rem;
  }

  .nav-container {
    gap: 0.5rem;
  }

  .nav-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .nav-btn .icon {
    display: none;
  }

  main.container {
    margin: 1rem auto;
    padding: 0 0.75rem;
  }

  .calendar {
    padding: 0.2rem;
  }

  .calendar-grid {
    gap: 0.08rem;
  }

  .calendar-day {
    padding: 0.15rem;
    aspect-ratio: 1;
    font-size: 0.45rem;
  }

  .calendar-day-number {
    font-size: 0.5rem;
    font-weight: 900;
  }

  .calendar-day-routines {
    font-size: 0.35rem;
    gap: 0.04rem;
  }

  .monthly-routine-item {
    padding: 0.08rem 0.12rem;
  }

  .monthly-routine-name {
    font-size: 0.35rem;
  }

  .monthly-routine-blocks {
    font-size: 0.32rem;
  }

  .detail-block-actions {
    grid-template-columns: 1fr;
  }

  .btn-create-routine {
    display: none !important;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .form-group {
    gap: 0.35rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.6rem;
    font-size: 0.95rem;
  }

  .color-option {
    width: 40px;
    height: 40px;
  }

  .color-picker-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .color-picker-grid .color-option {
    height: 40px;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-actions {
    padding: 1rem;
    gap: 0.5rem;
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
    border-radius: 16px;
  }

  .modal-content.modal-large,
  .modal-content.modal-xlarge {
    width: 95%;
  }

  .schedule-grid {
    grid-template-columns: 50px 1fr;
    gap: 0.2rem;
  }

  .schedule-time-slot,
  .schedule-block {
    padding: 0.5rem;
    font-size: 0.7rem;
  }

  .schedule-block-exercises {
    max-height: 40px;
  }

  .exercise-field {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
  }

  .exercise-field input {
    padding: 0.45rem;
    font-size: 0.8rem;
  }

  .rep-type-btn {
    padding: 0.35rem 0.45rem;
    font-size: 0.75rem;
  }

  .weights-label {
    font-size: 0.8rem;
  }

  .weights-grid {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 0.25rem;
  }

  .exercise-weight-item {
    padding: 0.35rem !important;
    font-size: 0.75rem;
  }

  .exercise-field .exercise-remove {
    padding: 0.45rem;
    align-self: flex-end;
  }

  .routine-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .routine-item-name {
    font-size: 1rem;
  }

  .routine-item-meta {
    font-size: 0.85rem;
  }

  .routine-card {
    padding: 1rem;
  }

  .modal-content {
    max-height: 95vh;
  }

  #miniCalendarContainer {
    gap: 0.25rem;
    font-size: 0.7rem;
  }

  .mini-calendar-day {
    padding: 0.15rem;
  }

  .current-file-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .file-input-wrapper {
    flex-direction: column;
  }

  .file-input-wrapper button {
    width: 100%;
  }

  .metric-card {
    padding: 1rem;
  }

  .metric-value {
    font-size: 1.25rem;
  }

  /* Personas Module - Mobile */
  .active-person-indicator {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .active-person-indicator strong {
    display: block;
    margin-bottom: 0.25rem;
  }

  .active-person-indicator button {
    width: 100%;
  }

  .form-section {
    padding: 1rem;
  }

  .form-section h3 {
    font-size: 1rem;
  }

  .form-section > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .form-section input[type="text"],
  .form-section input[type="email"] {
    width: 100% !important;
    flex: none !important;
  }

  .form-section button {
    width: 100%;
  }

  .personas-list {
    max-height: 300px;
  }

  .persona-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .persona-info {
    width: 100%;
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .persona-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
    align-self: center;
  }

  .persona-details {
    width: 100%;
  }

  .persona-name {
    font-size: 1rem;
  }

  .persona-email {
    font-size: 0.85rem;
  }

  .persona-date {
    font-size: 0.8rem;
  }

  .persona-actions {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }

  .persona-actions button {
    flex: 1;
  }

  .persona-badge-active {
    width: 100%;
    text-align: center;
  }
}

/* Large Screens */
@media (min-width: 1200px) {
  main.container {
    max-width: 1400px;
  }

  .form-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .schedule-grid {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
  }

  .modal-xlarge {
    max-width: 1400px;
  }
}
