select[multiple].w-full {
    width: 100%;
    box-sizing: border-box;
}

/* ===================================================================
   DUAL LAYOUT SYSTEM: Mobile Flexbox + Desktop Masonry
   ===================================================================
   Mobile (≤640px): Natural flexbox flow for stability
   Desktop (>640px): CSS Grid masonry for optimal layout
*/

/* FIXED DUAL LAYOUT: Proper scroll hierarchy */
.project-container {
  /* @apply w-full min-h-0 flex-1 bg-stone-100; */
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  /* Tailwind stone-100 */
  background-color: #f5f5f4;
  /* No overflow here - parent container should handle scroll */
}

/* MOBILE LAYOUT: Simple flexbox (higher priority) */
@media (max-width: 640px) {
  .project-container {
    /* @apply flex flex-col gap-4 p-4; */
    display: flex !important; /* Override any grid display */
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;

    /* Override any grid settings from desktop */
    grid-template-columns: none !important;
    grid-auto-rows: auto !important;
  }

  .project-container .item {
    /* @apply w-full mb-0; */
    width: 100%;
    margin-bottom: 0;
    /* Force grid items to behave like flex items */
    grid-row-end: auto !important;
    grid-row-start: auto !important;
  }
}

/* OPTIONAL: Large-phone dual column (non-grid, Pinterest-like)
   Activate by adding class .mobile-cols-2 to #project-list (project-container)
   We use CSS multi-column for simple, staggered visual; reading order is per-column. */
@media (min-width: 480px) and (max-width: 640px) {
  .project-container.mobile-cols-2 {
    /* override mobile flex layout */
    display: block !important;
    column-count: 2;
    column-gap: 1rem;
    padding: 0 1rem; /* similar horizontal padding */
  }
  .project-container.mobile-cols-2 .item {
    break-inside: avoid;
    width: 100%;
    display: inline-block; /* needed inside multi-column */
    margin: 0 0 1rem; /* vertical spacing between items */
  }
}

/* DESKTOP DEFAULT: Prevent single-column flash on desktop */
@media (min-width: 641px) {
  .project-container {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: auto; /* Use auto initially, JavaScript sets to 2px */
  }
}

/* DESKTOP LAYOUT: Only when JavaScript adds .desktop-masonry */
.project-container.desktop-masonry {
  display: grid;
  grid-gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 2px;
  /* No overflow here - parent handles scroll */
}

/* DESKTOP LAYOUT: Responsive masonry columns */
@media (min-width: 641px) and (max-width: 768px) {
  .project-container.desktop-masonry {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .project-container.desktop-masonry {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* LEGACY SUPPORT: Maintain .masonry-grid class for backwards compatibility */
.masonry-grid {
  /* @apply w-full min-h-0 flex-1 bg-stone-100 overflow-y-auto; */
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  background-color: #f5f5f4;
  overflow-y: auto;
}

@media (min-width: 641px) {
  .masonry-grid {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 2px;
  }
}


/*div {*/
/*    border: solid 1px red;*/
/*}*/

/*.inner-card {*/
/*}*/

.month-container {
    display: grid;
    grid-template-rows: 1fr 6fr;
    justify-content: space-between;
    border: solid 2px var(--first-color);
    width: auto;
    border-radius: 5px;
    margin-bottom: .5rem;
}


.comment {
    /*border: 1px solid lightslategray;*/
    /*border-radius: 5px;*/
    margin-bottom: 10px;
    padding: 5px;
}

.media {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.media-body {
    flex: 1;
    padding: 5px;
}

.media-list {
    width: 100%;
    max-width: 800px;
    margin-left: 0;
}

.step-primary::before {
    background-color: #D97706;
    color: white;
    border-color: #D97706;
}


/* Fix for django-quill-editor */
.ql-toolbar {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    background-color: #f9fafb;
}

.ql-container {
    font-family: 'Inter', sans-serif !important;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.ql-editor {
    min-height: 200px;
}

/* Fix for modal quill editor */
#modal-content .ql-toolbar,
#modal-content .ql-container {
    z-index: 70;
}

/* Make sure form controls in modals have appropriate spacing */
#modal-content .form-control {
    margin-bottom: 1rem;
}

/* Fix for django-quill-editor in forms */
.quill-editor-container {
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.quill-editor-container .ql-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
}

.quill-editor-container .ql-container {
    flex-grow: 1;
}

/* Hide the underlying textarea that django-quill creates */
.django-quill-editor textarea {
    display: none !important;
}

/* Specific styles for smaller screens */
@media (max-width: 640px) {
    .quill-editor-container {
        min-height: 200px;
    }
    .modal-box {
        max-width: 90vw;
        padding: 1rem;
    }

    /* Mobile form improvements */
    .form-control, input, textarea, select {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }

    /* Mobile-friendly button spacing */
    .btn {
        min-height: 44px; /* iOS minimum touch target */
        margin: 0.25rem 0;
    }

    /* Better spacing for mobile forms */
    .form__field {
        margin-bottom: 1rem;
    }

    /* Mobile button improvements */
    .btn {
        min-height: 44px; /* iOS minimum touch target */
        margin: 0.25rem 0;
    }
}

/*Alpine js style*/

[x-cloak] {
    display: none !important;
}


/*positiondate avatar*/
/* Add to your CSS */
.team-member-avatar {
    position: relative;
    display: inline-block;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar.grayscale {
    filter: grayscale(100%);
}

.name-plate-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.status-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.status-none {
    background-color: #d3d3d3;
    color: #666;
}

.status-pending {
    background-color: #ffc107;
    color: white;
}

.status-accepted {
    background-color: #28a745;
    color: white;
}

.status-changes {
    background-color: #17a2b8;
    color: white;
}

.contact-options-link {
    margin-left: 5px;
}

/*ITEM MODAL STYLES*/
.form-control {
    width: 100%;
}

input, textarea, select {
    max-width: 100%;
}

/* Custom textarea width overrides */
.textarea {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* More specific override for comment forms */
.comment-form .textarea {
  width: 100% !important;
}

/* ----------------------------------------------------------
   Avatar utilities (ProjShare)
   ----------------------------------------------------------
   Purpose: Provide consistent, responsive, and round avatar
   styling across the app while avoiding one-off styles.

   Usage:
     <img class="ps-avatar ps-avatar--sm" ...>
     <div class="ps-profile-avatar-frame"><img class="ps-avatar" ...></div>
*/

.ps-avatar {
  display: inline-block;
  border-radius: 9999px; /* rounded-full */
  object-fit: cover;
  object-position: center;
  background-color: #f3f4f6; /* gray-100 fallback */
  aspect-ratio: 1 / 1;
}

/* Common sizes */
.ps-avatar--sm { width: 32px; height: 32px; }
.ps-avatar--md { width: 40px; height: 40px; }
.ps-avatar--lg { width: 64px; height: 64px; }
.ps-avatar--xl { width: 96px; height: 96px; }
/* Parity size with Tailwind w-11/h-11 (44px) */
.ps-avatar--44 { width: 44px; height: 44px; }

/* Profile page avatar frame: consistent but responsive */
.ps-profile-avatar-frame { width: 180px; aspect-ratio: 1 / 1; }
@media (min-width: 640px) { .ps-profile-avatar-frame { width: 200px; } }
@media (min-width: 768px) { .ps-profile-avatar-frame { width: 240px; } }
@media (min-width: 1024px) { .ps-profile-avatar-frame { width: 280px; } }

.ps-profile-avatar-frame > img.ps-avatar { width: 100%; height: 100%; }

/* ----------------------------------------------------------
   Performance & Accessibility Improvements
   ----------------------------------------------------------

   ROLLBACK INSTRUCTIONS:
   To restore original colors, delete this entire section
   from "Performance & Accessibility Improvements" to the end
   and keep only the original css above.
*/

/* Enhanced color contrast for accessibility compliance */
/* Original cyan-700: #0f766e -> Enhanced to slightly darker cyan-800: #115e59 */
/* Original amber-600: #d97706 -> Enhanced to slightly darker amber-700: #b45309 */

/* Apply enhanced contrast to key elements - ROLLBACK: Remove this section */
.text-cyan-700 { color: #0e7490 !important; } /* Using cyan-600 instead for better visibility */
.text-amber-600 { color: #d97706 !important; } /* Keep original amber as it has good contrast */
.bg-cyan-700 { background-color: #0e7490 !important; }
.border-cyan-700 { border-color: #0e7490 !important; }
.hover\:bg-cyan-800:hover { background-color: #155e75 !important; }

/* Enhanced button contrast */
.btn-outline.text-cyan-700 {
  color: #0e7490 !important;
  border-color: #0e7490 !important;
}

/* Enhanced link contrast - more conservative approach */
a:not(.btn):not(.tab) {
  color: #0e7490 !important;
}

/* Enhanced text readability - more conservative */
.text-stone-600 { color: #57534e !important; } /* Darker stone but not too dark */
.text-gray-500 { color: #6b7280 !important; } /* Keep reasonable gray */

/* Performance & Layout Shift Improvements */
/* Image optimization with aspect ratio preservation */
.aspect-ratio-img {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.aspect-ratio-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar containers with fixed dimensions */
.avatar-container {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
}

/* Prevent layout shift during loading */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Minimize content jump */
.content-container {
  min-height: 100vh;
  padding-top: 80px; /* Account for fixed navbar */
}

/* Grid container stability - merged into main .masonry-grid rule above */

/*!*js-tree*!*/
/*!* Tailwind-based custom styles for jstree *!*/
/*.jstree-node {*/
/*    @apply inline-flex items-center space-x-2 p-2 rounded hover:bg-gray-100;*/
/*}*/

/*.jstree-anchor {*/
/*    @apply text-blue-600 font-medium hover:underline;*/
/*}*/

/*.jstree-children {*/
/*    @apply ml-4 mt-2 border-l border-gray-300 pl-4;*/
/*}*/

/*!* Custom styles for jsTree to ensure proper spacing and indentation *!*/

/*!* Add vertical spacing between all nodes *!*/
/*.jstree-container-ul .jstree-node {*/
/*    margin-bottom: 0.5rem; !* Adjust as needed *!*/
/*}*/

/*!* Ensure nested lists (child nodes) are properly indented *!*/
/*.jstree-container-ul .jstree-children {*/
/*    padding-left: 1.5rem; !* Adjust indentation level as needed *!*/
/*}*/

/*!* Optional: Adjust the line height of the node text for better vertical alignment *!*/
/*.jstree-anchor {*/
/*    line-height: 24px !important; !* Match height of icons/buttons if any *!*/
/*}*/
