/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is suggested that you include your application-wide styles in a separate file and require it here.
 *
 *= require_tree .
 *= require_self
 */

/* Drawer Animation Styles */
[data-collapsible-target="content"] {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

[data-collapsible-target="icon"] {
  transition: transform 0.3s ease-out;
}

.collapsible-open [data-collapsible-target="icon"] {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  [data-collapsible-target="content"] {
    max-height: none !important;
    opacity: 1 !important;
  }
}

[data-controller="collapsible"] [data-collapsible-target="content"]:focus,
[data-controller="collapsible"] button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Responsive drawer adjustments */
@media (max-width: 768px) {
  [data-controller="collapsible"] {
    margin-bottom: 1rem;
    transition: all 0.3s ease-in-out;
    height: auto;
    min-height: 0;
  }
  
  [data-controller="collapsible"][data-collapsible-open-value="false"] {
    height: auto;
    min-height: 0;
  }
  
  [data-collapsible-target="content"] {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    will-change: max-height, opacity;
  }
  
  [data-controller="collapsible"][data-collapsible-open-value="false"] [data-collapsible-target="content"] {
    max-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
  }
  
  [data-controller="collapsible"][data-collapsible-open-value="false"] [data-collapsible-target="content"] > * {
    display: none !important;
  }
  
  [data-collapsible-target="button"] {
    padding: 1rem;
  }
}

/* Dark mode drawer enhancements */
@media (prefers-color-scheme: dark) {
  [data-drawer-target="button"]:hover {
    background-color: rgba(55, 65, 81, 0.5);
  }
}

/* Focus states for accessibility */
[data-drawer-target="button"]:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

/* Scale animation for button feedback */
[data-drawer-target="button"].scale-95 {
  transform: scale(0.95);
}
