/* ========================================================================
   MOBILE-FIRST COMPONENT SYSTEM
   Bootstrap-inspired responsive components for Iris
   ======================================================================== */

/* ========================================================================
   1. BASE TYPOGRAPHY - Mobile First
   ======================================================================== */

/* Base font sizes - scale up for larger screens */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

/* Responsive typography */
@media (min-width: 640px) {
  .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
}

@media (min-width: 1024px) {
  .lg\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .lg\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .lg\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .lg\:text-5xl { font-size: 3rem; line-height: 1; }
}

/* ========================================================================
   2. CONTAINER SYSTEM - Bootstrap-like
   ======================================================================== */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

.container-fluid {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ========================================================================
   3. GRID SYSTEM - Mobile First
   ======================================================================== */

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

@media (min-width: 640px) {
  .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
}

@media (min-width: 1024px) {
  .row {
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

[class*="col-"] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 1024px) {
  [class*="col-"] {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Mobile (default) - all full width */
.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333333%; }
.col-3 { width: 25%; }

/* Small devices (sm: 640px+) */
@media (min-width: 640px) {
  .sm\:col-12 { width: 100%; }
  .sm\:col-6 { width: 50%; }
  .sm\:col-4 { width: 33.333333%; }
  .sm\:col-3 { width: 25%; }
}

/* Medium devices (md: 768px+) */
@media (min-width: 768px) {
  .md\:col-12 { width: 100%; }
  .md\:col-6 { width: 50%; }
  .md\:col-4 { width: 33.333333%; }
  .md\:col-3 { width: 25%; }
}

/* Large devices (lg: 1024px+) */
@media (min-width: 1024px) {
  .lg\:col-12 { width: 100%; }
  .lg\:col-8 { width: 66.666667%; }
  .lg\:col-6 { width: 50%; }
  .lg\:col-4 { width: 33.333333%; }
  .lg\:col-3 { width: 25%; }
}

/* ========================================================================
   4-10. CARDS, BUTTONS, TABLES, BADGES, ALERTS, FORMS, STAT CARDS
   Defined once in static/src/tailwind.css (compiled into iris.css).
   Do not redefine them here: this file loads after iris.css and would win.
   ======================================================================== */

/* ========================================================================
   11. UTILITY CLASSES - Responsive Spacing
   ======================================================================== */

/* Responsive padding */
.p-mobile { padding: 1rem; }
.p-tablet { padding: 1rem; }
.p-desktop { padding: 1rem; }

@media (min-width: 640px) {
  .p-tablet { padding: 1.5rem; }
  .p-desktop { padding: 1.5rem; }
}

@media (min-width: 1024px) {
  .p-desktop { padding: 2rem; }
}

/* Responsive margin */
.m-mobile { margin: 1rem; }
.m-tablet { margin: 1rem; }
.m-desktop { margin: 1rem; }

@media (min-width: 640px) {
  .m-tablet { margin: 1.5rem; }
  .m-desktop { margin: 1.5rem; }
}

@media (min-width: 1024px) {
  .m-desktop { margin: 2rem; }
}

/* Responsive gap */
.gap-mobile { gap: 0.75rem; }
.gap-tablet { gap: 0.75rem; }
.gap-desktop { gap: 0.75rem; }

@media (min-width: 640px) {
  .gap-tablet { gap: 1rem; }
  .gap-desktop { gap: 1rem; }
}

@media (min-width: 1024px) {
  .gap-desktop { gap: 1.5rem; }
}

/* Hide/Show responsive */
.mobile-only { display: block; }
.tablet-up { display: none; }
.desktop-up { display: none; }

@media (min-width: 640px) {
  .mobile-only { display: none; }
  .tablet-up { display: block; }
}

@media (min-width: 1024px) {
  .desktop-up { display: block; }
}

/* Touch target sizing */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Safe area padding for notched devices */
.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
  padding-left: env(safe-area-inset-left);
}

.safe-area-right {
  padding-right: env(safe-area-inset-right);
}

/* ========================================================================
   COLLAPSIBLE SIDEBAR STYLES
   ======================================================================== */

/* Sidebar collapsed state */
#sidebar.sidebar-collapsed {
  overflow-x: hidden;
}

/* Smooth transitions for sidebar width */
#sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text elements fade animation */
.sidebar-text {
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
  white-space: nowrap;
}

/* Hide text when sidebar is collapsed */
#sidebar.sidebar-collapsed .sidebar-text {
  opacity: 0 !important;
  visibility: hidden !important;
  width: 0;
  overflow: hidden;
}

/* Collapsed state: hide section headers */
#sidebar.sidebar-collapsed .px-3.mb-2 {
  opacity: 0;
  visibility: hidden;
  height: 0;
  margin: 0;
  overflow: hidden;
}

/* Collapsed state: center icons */
#sidebar.sidebar-collapsed nav a,
#sidebar.sidebar-collapsed button {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Collapsed state: adjust spacing */
#sidebar.sidebar-collapsed .flex.items-center.space-x-3 {
  justify-content: center;
  space-x: 0;
}

/* Tooltip on hover when collapsed */
@media (min-width: 1024px) {
  #sidebar.sidebar-collapsed nav a {
    position: relative;
  }
  
  #sidebar.sidebar-collapsed nav a:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgb(17, 24, 39);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    pointer-events: none;
  }
  
  .dark #sidebar.sidebar-collapsed nav a:hover::after {
    background-color: rgb(55, 65, 81);
  }
}

/* Collapse button icon rotation */
.sidebar-collapse-button svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure proper spacing when collapsed */
#sidebar.sidebar-collapsed .border-b {
  padding-left: 1rem;
  padding-right: 1rem;
}

