/* FMI Masonry Gallery - Consolidated Single CSS File v2.0.0 */

/* Root Layout Variables */
:root {
  --background-color: #f2f3f5;
  --sidebar-width-open: 280px;
  --hero-purple: #71559c;
  --sidebar-black: #000000;
  --text-white: #ffffff;
  --thumbs-green: #46b450;
  --star-gold: #f5a623;
  --filter-text-gray: #bfbfbf;
}

/* ============================================================
   SMOOTH LOADING - Progress Bar & Fade Animation
   ============================================================ */

/* Loading bar container - sits above the grid */
.fmi-mg-load-bar-wrap {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(200, 200, 200, 0.3);
  margin-bottom: 16px;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fmi-mg-load-bar-wrap.loading {
  opacity: 1;
}

.fmi-mg-load-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hero-purple), #71559c);
  border-radius: 2px;
  transition: width 0.15s ease-out;
}

/* Load More Button - Progress Fill Effect */
.fmi-mg-loadmore button {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: color 0.2s ease;
}

.fmi-mg-loadmore button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--load-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--hero-purple), #71559c);
  z-index: -1;
  transition: width 0.15s ease-out;
}

.fmi-mg-loadmore button.loading-progress {
  color: #fff;
  border-color: var(--hero-purple);
}

.fmi-mg-loadmore button.loading-progress::before {
  opacity: 1;
}

/* Font Family Override - Force Poppins Throughout */
.fmi-mg-wrap,
.fmi-mg-hero-content,
.fmi-mg-hero h1,
.fmi-mg-hero-subtitle,
.fmi-mg-category-btn,
.fmi-mg-btn,
button,
.fmi-mg-loadmore button,
.fmi-mg-sidebar-content {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Main Container */
.fmi-mg-wrap { 
  margin: 0;
  max-width: 100vw;
  min-height: 100vh;
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Layout Container */
.fmi-mg-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* ============================================================
   SIDEBAR WITH PUSH BEHAVIOR & TAB TOGGLE
   ============================================================ */

/* Left Sidebar - Pushes content when open */
.fmi-mg-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width-open);
  background-color: var(--sidebar-black);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
  transform: translateX(-280px);
  display: flex;
  flex-direction: column;
}

.fmi-mg-sidebar.open {
  transform: translateX(0);
}

/* Sidebar Content — scrollable area */
.fmi-mg-sidebar-content {
  padding: 20px 16px 0;
  width: 100%;
  color: var(--text-white);
  box-sizing: border-box;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Filters Heading with Integrated Toggle Button */
.fmi-mg-sidebar h3 {
  color: var(--text-white);
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 600;
}

.fmi-mg-sidebar h3 .filters-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toggle Button - Integrated in heading */
.fmi-mg-sidebar-toggle {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-white);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fmi-mg-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Tab Toggle Button - Left Edge, Aligned with Hero */
.fmi-mg-mobile-toggle {
  position: fixed;
  top: 165px; /* Align with hero image top */
  left: 0;
  width: 45px;
  height: 60px;
  background: var(--sidebar-black);
  border: none;
  border-radius: 0 8px 8px 0;
  color: var(--text-white);
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.fmi-mg-mobile-toggle:hover {
  background: #1a1a1a;
  width: 50px;
}

.fmi-mg-mobile-toggle svg {
  width: 24px;
  height: 24px;
}

/* Hide tab when sidebar is open */
.fmi-mg-sidebar.open ~ .fmi-mg-mobile-toggle {
  opacity: 0;
  pointer-events: none;
}

/* Sidebar Overlay - Remove, not needed with push behavior */
.fmi-mg-sidebar-overlay {
  display: none !important;
}

/* Custom scrollbar for sidebar content */
.fmi-mg-sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.fmi-mg-sidebar-content::-webkit-scrollbar-track {
  background: #333;
}

.fmi-mg-sidebar-content::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 4px;
}

.fmi-mg-sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* Firefox scrollbar */
.fmi-mg-sidebar-content {
  scrollbar-width: thin;
  scrollbar-color: #666 #333;
}

/* ============================================================
   FILTER SECTIONS
   ============================================================ */

.fmi-mg-filter-section {
  margin-bottom: 25px;
}

.fmi-mg-filter-section h4 {
  color: var(--text-white);
  font-size: 15px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid #444;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 500;
}

.fmi-mg-filter-section h4:after {
  content: '+';
  font-size: 20px;
  font-weight: normal;
}

.fmi-mg-filter-section.expanded h4:after {
  content: '−';
}

.fmi-mg-filter-options {
  display: none;
}

.fmi-mg-filter-section.expanded .fmi-mg-filter-options {
  display: block;
}

.fmi-mg-filter-option {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fmi-mg-filter-option input[type="checkbox"],
.fmi-mg-filter-option input[type="radio"] {
  margin: 0;
}

.fmi-mg-filter-option label {
  color: #e8e8e8;  /* or #e0e0e0 for even lighter */
  font-size: 13px;
  cursor: pointer;
  margin: 0;
  font-family: 'Poppins', sans-serif !important;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.fmi-mg-filter-option label:hover {
  color: var(--text-white);
}

.fmi-mg-filter-option input[type="radio"]:checked + label {
  color: var(--text-white);
}

/* Filter Action Buttons */
.fmi-mg-filter-actions {
  padding: 16px 16px 24px;
  border-top: 1px solid #444;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  background-color: var(--sidebar-black);
}

.fmi-mg-filter-submit,
.fmi-mg-filter-refresh {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fmi-mg-filter-submit {
  background: #71559c;
  color: white;
}

.fmi-mg-filter-submit:hover {
  background: #350080;
  transform: translateY(-1px);
}

.fmi-mg-filter-refresh {
  background: #666;
  color: white;
}

.fmi-mg-filter-refresh:hover {
  background: #555;
  transform: translateY(-1px);
}

.fmi-mg-filter-submit:active,
.fmi-mg-filter-refresh:active {
  transform: translateY(0);
}

.fmi-mg-filter-submit:disabled,
.fmi-mg-filter-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Disabled filter labels */
.fmi-mg-filter-option input[type="radio"]:disabled + label.disabled-label {
  opacity: 0.6;
  cursor: not-allowed;
  color: #f0f0f0;
}

.fmi-mg-filter-option input[type="radio"]:disabled + label.disabled-label:hover {
  color: #f0f0f0;
}

/* ============================================================
   MAIN CONTENT AREA - PUSHES WHEN SIDEBAR OPENS
   ============================================================ */

.fmi-mg-main-content {
  margin-left: 0;
  width: 100%;
  transition: all 0.3s ease;
  min-height: 100vh;
}

/* Push content when sidebar is open */
.fmi-mg-sidebar.open ~ .fmi-mg-main-content {
  margin-left: var(--sidebar-width-open);
  width: calc(100% - var(--sidebar-width-open));
}

/* Hero Section */
.fmi-mg-hero {
  position: relative;
  height: 400px;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  margin-bottom: 30px;
  min-height: 400px !important;
  margin-left: 6%;
  margin-right: 6%;
  border-radius: 0 0 48px 0;
}

.fmi-mg-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
}

.fmi-mg-hero-content {
  position: relative;
  z-index: 2;
  padding: 30px 30px;
  color: var(--text-white);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

.fmi-mg-hero h1 {
  font-size: 72px !important;
  font-weight: 500 !important;
  line-height: 1.067 !important;
  margin: 0 0 24px 0 !important;
  text-shadow: none !important;
  letter-spacing: -1.26px !important;
  word-spacing: -2.16px !important;
  font-family: 'Poppins', sans-serif !important;
}

.fmi-mg-hero-subtitle {
  font-size: 24px !important;
  font-weight: 500 !important;
  line-height: 1.067 !important;
  margin: 0 !important;
  text-shadow: none !important;
  letter-spacing: -0.28px !important;
  word-spacing: -0.72px !important;
  font-family: 'Poppins', sans-serif !important;
}

.fmi-mg-hero-subtitle div {
  margin-bottom: 6px !important;
}

/* Hero video container for Icebergs */
.hero-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1s ease-in;
}

.hero-video.loaded {
  opacity: 1;
}

/* ============================================================
   CATEGORY BUTTONS
   ============================================================ */

.fmi-mg-category-buttons {
  padding: 0 6% !important;
  margin-bottom: 50px !important;
}

.fmi-mg-category-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding-right: 120px; /* reserve space for the lightbox button */
}

.fmi-mg-cat-btn-wrap {
  display: contents; /* transparent wrapper - children behave as direct row children */
}

.fmi-mg-lb-nav-wrap {
  position: absolute;
  top: 0;
  right: 0;
}

.fmi-mg-category-btn {
  background: #d9cfe8 !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 10px 18px !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  font-family: 'Poppins', sans-serif !important;
  color: #666666 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

.fmi-mg-category-btn:hover,
.fmi-mg-category-btn.active {
  background: #bfacd1 !important;
  color: #333 !important;
  transform: translateY(-1px) !important;
  font-weight: 500 !important;
}

/* Coming Soon / In Production Categories */
.fmi-mg-category-btn.prod {
  background: #D8D1E3 !important;
  color: #A3A2A2 !important;
  cursor: not-allowed !important;
  opacity: 0.9 !important;
}

.fmi-mg-category-btn.prod:hover {
  background: #D8D1E3 !important;
  color: #A3A2A2 !important;
  transform: none !important;
  font-weight: 400 !important;
}

/* Hide placeholder/coming-soon buttons and approved button */
.fmi-mg-category-btn.prod,
.fmi-mg-category-btn[data-category="approved"] {
  display: none !important;
}

/* ============================================================
   MASONRY GRID
   ============================================================ */

.fmi-mg-grid-container {
  padding: 0 6%;
}

.fmi-mg-grid {
  margin-bottom: 40px;
}

.fmi-mg-item { 
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px !important;
  width: calc(25% - 8px);
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
}

/* Fade in after masonry layout complete */
.fmi-mg-item.fmi-mg-item-visible {
  opacity: 1;
}

/* Hover effect */
.fmi-mg-item:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-out, opacity 0.35s ease-in-out;
}

.fmi-mg-card { 
  position: relative; 
  perspective: 1000px;
  background: #f3f4f6;
  min-height: 100px;
}

/* ============================================================
   IMAGE BUTTONS - SVG PILL SHAPE
   ============================================================ */

.fmi-mg-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.fmi-mg-image-container img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.fmi-mg-card:hover .fmi-mg-image-container img {
  transform: scale(1.02);
}

.fmi-mg-action-buttons {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: none;
  background: #fff;
  border: 1px solid #000; /* Reduced from 3px to 2px (50% smaller overall) */
  border-radius: 20px; /* Reduced from 50px */
  padding: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); /* Reduced shadow */
}

.fmi-mg-card:hover .fmi-mg-action-buttons {
  opacity: 1;
  pointer-events: auto;
}

/* Individual icon button - transparent sections with padding */
.fmi-mg-icon-btn {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 3px 5px; /* Reduced 50% from 10px 14px */
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: none;
  position: relative;
}

/* Black divider lines between sections */
.fmi-mg-icon-btn:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 1px; /* Reduced from 3px */
  background: #000;
}

.fmi-mg-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.fmi-mg-icon-btn:active {
  transform: scale(0.95);
}

/* SVG icons - 25% larger than before (was 56px, now 70px) */
.fmi-mg-icon-btn svg {
  width: 35px; /* Increased 25% from 56px */
  height: 35px;
  display: block;
  fill: #000;
}

/* Thumbs-up button specific */
.fmi-mg-thumbs-btn svg {
  fill: #000;
}

.fmi-mg-thumbs-btn:hover svg {
  fill: var(--thumbs-green);
}

.fmi-mg-thumbs-btn.voted svg,
.fmi-mg-thumbs-btn.saved svg {
  fill: var(--thumbs-green);
}

/* Star (favorite) button — FA icon, outline default → solid gold when saved */
.fmi-mg-star-btn {
  font-size: 0; /* collapse whitespace */
}
.fmi-mg-star-btn .fa-star {
  font-size: 17px;
  color: #000;
  transition: color 0.2s ease;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fmi-mg-star-btn:hover .fa-star {
  color: var(--star-gold);
}
.fmi-mg-star-btn.saved .fa-star {
  color: var(--star-gold);
}

/* My Favorites pill — distinct from theme pills, logged-in only */
.fmi-favorites-btn {
  background: transparent;
  border: 2px solid var(--star-gold) !important;
  color: var(--star-gold) !important;
  font-weight: 600;
}
.fmi-favorites-btn:hover,
.fmi-favorites-btn.active {
  background: var(--star-gold) !important;
  color: #000 !important;
}
.fmi-favorites-btn .fa-star {
  font-size: 13px;
  margin-right: 4px;
}

/* Browse All — plain text, same style as aspect nav buttons */
.fmi-mg-browse-all-link {
  font-size: 12px;
  font-weight: 400;
  font-family: 'Poppins', sans-serif;
  color: #888888;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s ease;
  padding: 4px 8px;
  text-transform: capitalize;
}
.fmi-mg-browse-all-link:hover {
  color: #333;
}
.fmi-mg-browse-all-link.active {
  color: #333;
  font-weight: 600;
}

/* ── Search bar (v2.1.147) ── */
.fmi-mg-search-wrap {
  position: relative;
  margin-right: 12px;
  flex-shrink: 0;
}
.fmi-mg-search-input {
  height: 24px;
  padding: 0 2px;
  border: none;
  border-bottom: 1px solid #bbb;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  color: #333;
  width: 160px;
  outline: none;
  transition: border-color 0.2s;
}
.fmi-mg-search-input:focus {
  border-bottom-color: #333;
}
.fmi-mg-search-input::placeholder {
  color: var(--filter-text-gray);
}
.fmi-mg-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 999;
}
.fmi-mg-search-dropdown li {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #333;
}
.fmi-mg-search-dropdown li:hover,
.fmi-mg-search-dropdown li.active {
  background: #f3f0f8;
  color: var(--hero-purple);
}
.fmi-search-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-left: 8px;
  flex-shrink: 0;
}
.fmi-search-no-result {
  color: #999;
  font-style: italic;
  cursor: default;
  pointer-events: none;
}
.fmi-search-no-result em {
  color: #666;
  font-style: normal;
  font-weight: 500;
}
.fmi-search-browse-all {
  color: var(--hero-purple);
  cursor: pointer;
  border-top: 1px solid #f0f0f0;
  margin-top: 2px;
  padding-top: 8px !important;
}
.fmi-search-browse-all:hover {
  background: #f3f0f8;
}

/* Aspect row flex so search + aspect buttons sit on same line */
.fmi-mg-aspect-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: space-between;
  width: 100%;
}

@media (max-width: 600px) {
  .fmi-mg-search-input { width: 140px; }
  .fmi-mg-search-wrap  { margin-right: 8px; }
}

/* Thumbs-up tile toast */
.fmi-mg-thumbs-toast {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.fmi-mg-thumbs-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Trash button specific */
.fmi-mg-trash-btn svg {
  fill: #000;
}

.fmi-mg-trash-btn:hover svg {
  fill: #dc2626;
}

/* Plus button specific */
.fmi-mg-plus-btn svg {
  fill: #000;
}

.fmi-mg-plus-btn:hover svg {
  fill: #71559c;
}

/* Remove dark overlay on hover since buttons are now visible */
.fmi-mg-card:hover .fmi-mg-image-container::after {
  display: none;
}

.fmi-mg-icon-btn:focus {
  outline: 2px solid rgba(64, 0, 159, 0.6);
  outline-offset: 2px;
}

.fmi-mg-icon-btn:focus-visible {
  outline: 2px solid rgba(64, 0, 159, 1);
  outline-offset: 3px;
}

.fmi-mg-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   LOAD MORE & LIGHTBOX
   ============================================================ */

.fmi-mg-loadmore { 
  text-align: center;
  padding: 0 6% 40px;
}

.fmi-mg-loadmore button { 
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif !important;
}

.fmi-mg-loadmore button:hover {
  background: #f8f8f8;
  border-color: #999;
  transform: translateY(-1px);
}

.fmi-mg-loadmore button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.fmi-mg-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fmi-mg-modal.active {
  display: flex;
}

.fmi-mg-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fmi-mg-modal img {
  width: 100%;
  height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* ============================================================
   ZOOM CLOSE BUTTON - PILL STYLE MATCH
   ============================================================ */
.fmi-mg-modal-close {
  background: #fff !important;
  border: 1px solid #000 !important;
  border-radius: 22px 0 0 22px !important; /* Rounded left corners only */
  border-top-right-radius: 0 !important;   /* Sharp right edge */
  border-bottom-right-radius: 0 !important;
  width: 42px !important;
  height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 28px !important;
  font-weight: 400 !important;
  color: #000 !important;
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
  transition: background 0.2s ease, transform 0.2s ease !important;
  font-family: 'Poppins', sans-serif !important;
}
.fmi-mg-modal-close:hover {
  background: #f8f8f8 !important;
  transform: translateY(-1px) !important;
}


.fmi-mg-lightbox-info { 
  background: #fff; 
  color: #000; 
  font-size: 14px; 
  line-height: 1.4; 
  padding: 12px 20px; 
  margin: 10px auto 0;
  max-width: fit-content; 
  text-align: center; 
  border-radius: 6px;
  font-family: 'Poppins', sans-serif !important;
}

.fmi-mg-lightbox-info a.fmi-mg-download-link { 
  margin-left: 12px; 
  color: #0066cc; 
  font-weight: 600; 
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.fmi-mg-lightbox-info a.fmi-mg-download-link:hover { 
  text-decoration: underline;
  background: #f0f8ff;
}

/* ============================================================
   HIDE OLD ELEMENTS & SEARCH
   ============================================================ */

.fmi-mg-slideshow,
.fmi-mg-ticker,
.fmi-mg-controls,
.fmi-mg-title {
  display: none;
}

.fmi-mg-search-container,
.fmi-mg-search-bar,
.fmi-mg-search-btn,
#fmi-search-input,
#fmi-search-btn,
.search-container,
.search-bar {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* v2.1.154: Exempt FMI typeahead search from suppressor — shown via JS for logged-in users */
.fmi-mg-search-wrap,
.fmi-mg-search-input {
  display: revert !important;
  visibility: revert !important;
  height: revert !important;
  overflow: revert !important;
  pointer-events: revert !important;
}
.fmi-mg-search-dropdown {
  display: none;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
/* search-wrap hidden by default in template; JS shows it */
.fmi-mg-search-wrap {
  display: none;
}
.fmi-mg-search-input {
  display: block !important;
  visibility: visible !important;
  height: 24px !important;
  overflow: visible !important;
  pointer-events: auto !important;
  font-size: 12px !important;
  font-family: 'Poppins', sans-serif !important;
  color: #888 !important;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1200px) {
  .fmi-mg-item { 
    width: calc(33.333% - 8px);
  }
}

@media (max-width: 900px) {
  .fmi-mg-item { 
    width: calc(50% - 8px);
  }
  
  .fmi-mg-hero h1 {
    font-size: 72px !important;
  }
  
  .fmi-mg-hero-subtitle {
    font-size: 24px !important;
  }
}

@media (max-width: 768px) {
  .fmi-mg-sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    width: 280px;
    transform: translateX(-280px);
  }
  
  .fmi-mg-sidebar.open ~ .fmi-mg-main-content {
    margin-left: 0;
    width: 100%;
  }
  
  .fmi-mg-action-buttons {
    opacity: 1;
    pointer-events: auto;
    top: 8px;
    right: 8px;
  }
  
  .fmi-mg-icon-btn {
    padding: 5px 7px; /* Reduced 50% */
  }
  
  .fmi-mg-icon-btn svg {
    width: 70px; /* 25% larger */
    height: 70px;
  }
}

@media (max-width: 600px) {
  .fmi-mg-item { 
    width: 100%;
  }
}

@media (max-width: 500px) {
  .fmi-mg-hero {
    height: 300px;
  }
  
  .fmi-mg-hero h1 {
    font-size: 30px !important;
  }
  
  .fmi-mg-hero-subtitle {
    font-size: 16px !important;
  }
  
  .fmi-mg-category-row {
    gap: 8px;
  }
  
  .fmi-mg-category-btn {
    font-size: 13px !important;
    padding: 8px 14px !important;
  }
  
  .fmi-mg-filter-actions {
    padding: 15px 16px 25px;
    gap: 10px;
  }
  
  .fmi-mg-filter-submit,
  .fmi-mg-filter-refresh {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .fmi-mg-icon-btn {
    padding: 4px 6px; /* Reduced for mobile */
  }
  
  .fmi-mg-icon-btn svg {
    width: 60px; /* 25% larger than previous mobile size */
    height: 60px;
  }
  
  .fmi-mg-sidebar {
    width: 100%;
    max-width: 320px;
    transform: translateX(-100%);
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes rotation {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(359deg); 
  }
}

/* ============================================================
   BUTTON MOBILE
   ============================================================ */

@media (max-width: 768px) {
  .fmi-mg-action-buttons {
    border-radius: 22px !important; /* matches your + and × buttons */
  }
}


/* ============================================================
   PERMISSION-BASED BUTTON VISIBILITY (SECURITY)
   ============================================================ */

/* Hide moderation buttons for guests via body class */
body:not(.logged-in) .fmi-mg-thumbs-btn,
body:not(.logged-in) .fmi-mg-star-btn,
body:not(.logged-in) .fmi-mg-trash-btn,
body:not(.logged-in) .approve-btn,
body:not(.logged-in) .delete-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Hide via item-level class (more reliable) */
.user-guest .fmi-mg-thumbs-btn,
.user-guest .fmi-mg-star-btn,
.user-guest .fmi-mg-trash-btn,
.user-guest .approve-btn,
.user-guest .delete-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Ensure only plus button shows for guests */
.user-guest .fmi-mg-action-buttons {
  pointer-events: auto;
}

.user-guest .fmi-mg-plus-btn {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Star visible for all logged-in users (non-guest) */
.user-logged-in .fmi-mg-star-btn,
.user-can-moderate .fmi-mg-star-btn {
  display: flex !important;
  visibility: visible !important;
}

/* Show all buttons for moderators */
.user-can-moderate .fmi-mg-thumbs-btn,
.user-can-moderate .fmi-mg-trash-btn,
.user-can-moderate .fmi-mg-plus-btn {
  display: flex !important;
  visibility: visible !important;
}

/* Mobile-specific: maintain visibility rules */
@media (max-width: 768px) {
  body:not(.logged-in) .fmi-mg-thumbs-btn,
  body:not(.logged-in) .fmi-mg-star-btn,
  body:not(.logged-in) .fmi-mg-trash-btn,
  .user-guest .fmi-mg-thumbs-btn,
  .user-guest .fmi-mg-star-btn,
  .user-guest .fmi-mg-trash-btn {
    display: none !important;
    visibility: hidden !important;
  }
  
  .fmi-mg-action-buttons {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================
   INACTIVE PLACEHOLDER BUTTONS
   ============================================================ */

/* Inactive placeholder buttons - hover effect but no click action */
.fmi-mg-category-btn.inactive {
  background: #e8ddf3 !important;
  color: #999999 !important;
  cursor: default !important;
  opacity: 0.7 !important;
}

.fmi-mg-category-btn.inactive:hover {
  background: #ded1eb !important;
  color: #888888 !important;
  transform: none !important;
  font-weight: 400 !important;
}

/* Prevent active styling on inactive buttons */
.fmi-mg-category-btn.inactive.active {
  background: #e8ddf3 !important;
  color: #999999 !important;
  font-weight: 400 !important;
}

/* ============================================================
   LOGGED-OUT ZOOM BUTTON STYLE (View Full Size)
   ============================================================ */
body:not(.logged-in) .fmi-mg-plus-btn {
  border-radius: 22px 0 0 22px !important; /* Rounded left corners only */
  border-top-right-radius: 0 !important;   /* Sharp right edge */
  border-bottom-right-radius: 0 !important;
  background: #fff !important;
  border: 1px solid #000 !important;
  color: #000 !important;
  width: 42px !important;
  height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 28px !important;
  font-weight: 400 !important;
  color: #000 !important;
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
  transition: background 0.2s ease, transform 0.2s ease !important;
  font-family: 'Poppins', sans-serif !important;
  
}
body:not(.logged-in) .fmi-mg-plus-btn:hover {
  background: #f8f8f8 !important;
  transform: translateY(-1px) !important;
}

/* Remove double background under Zoom button for logged-out users */
body:not(.logged-in) .fmi-mg-action-buttons {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ============================================
   FMI Gallery - Video Mode Integrated Styles
   Works with existing gallery layout
   ============================================ */

/* Video Mode Indicator */
.fmi-mg-wrap[data-content-type="video"] {
  /* Maintains existing layout */
}

/* Hero Video Styles */
.fmi-mg-hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fmi-hero-video-sound-toggle {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.fmi-hero-video-sound-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.fmi-hero-video-sound-toggle .sound-icon {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.fmi-hero-video-sound-toggle.sound-on .sound-off-line {
  display: none;
}

/* Video Category Buttons - Purple/Inactive Style */
.video-category-btn {
  padding: 8px 20px;
  margin: 0 5px;
  background: #6b46c1 !important; /* Purple for inactive */
  color: rgba(255, 255, 255, 0.7) !important;
  border: 2px solid #6b46c1 !important;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.video-category-btn.inactive {
  background: #6b46c1 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  opacity: 0.8;
}

.video-category-btn.inactive:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.video-category-btn.active {
  background: #71559c !important; /* Brighter purple for active */
  color: #ffffff !important;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

/* Video Thumbnail Items in Grid */
.video-thumbnail-item {
  /* Uses existing .fmi-mg-item styles */
}

.video-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.video-card .fmi-mg-image-container {
  position: relative;
}

/* 16:9 Video Thumbnail Aspect Ratio */
.video-card .fmi-mg-image-container img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Video Play Overlay */
.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .video-play-overlay {
  opacity: 1;
}

.video-play-overlay svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.video-card:hover .video-play-overlay svg {
  transform: scale(1.1);
}

/* Video Title Under Thumbnail */
.video-thumb-title {
  padding: 10px;
  background: rgba(0, 0, 0, 0.05);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  text-align: center;
}

/* Video Player Modal */
.fmi-video-player-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fmi-video-player-content {
  position: relative;
  width: 95%;
  max-width: 1400px;
  max-height: 95vh;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  animation: videoModalSlideIn 0.35s ease-out;
}

@keyframes videoModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fmi-video-player-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  color: #333;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.fmi-video-player-close:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: scale(1.05);
}

#modalVideoPlayer {
  width: 100%;
  height: auto;
  max-height: 85vh;
  background: #000;
  border-radius: 0 0 16px 16px;
}

/* Ensure video filter is enabled */
#video-v2:not(:disabled) + label {
  color: #ffffff !important;
  cursor: pointer !important;
}


/* Hide Load More button in video mode */
.fmi-mg-wrap[data-content-type="video"] #fmi-mg-load {
  display: none !important;
}

/* Responsive adjustments for video mode */
@media (max-width: 768px) {
  .video-category-btn {
    font-size: 0.85rem;
    padding: 6px 15px;
    margin: 3px;
  }
  
  .fmi-hero-video-sound-toggle {
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }
  
  .video-thumb-title {
    font-size: 0.85rem;
    padding: 8px;
  }
  
  .fmi-video-player-content {
    width: 95%;
    border-radius: 4px;
  }
}

/* Smooth transitions when switching modes */
.fmi-mg-hero-image-wrapper {
  transition: opacity 0.3s ease;
}

.fmi-mg-category-row {
  transition: opacity 0.3s ease;
}

.fmi-mg-grid {
  transition: opacity 0.3s ease;
}

/* ============================================
   FMI Gallery - Video Mode CSS Enhancements

   ============================================ */


/* Video Mode Hero Styles */
.fmi-mg-wrap[data-content-type="video"] #fmi-hero {
  position: relative;
  background-size: cover;
  background-position: center;
}

.fmi-mg-hero-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.fmi-mg-hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  z-index: 1;
}

/* Hero overlay for video mode */
.fmi-mg-wrap[data-content-type="video"] .fmi-mg-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px;
  background: rgba(0,0,0,0.3);
  z-index: 2;
}

.fmi-mg-wrap[data-content-type="video"] .fmi-mg-hero-title {
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  margin-bottom: 20px;
}

.fmi-mg-hero-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  line-height: 1.6;
  margin: 0;
}

/* Hide category buttons in video mode */
.fmi-mg-wrap[data-content-type="video"] .fmi-mg-category-row {
  display: none !important;
}

/* Video thumbnail styles */
.video-thumbnail-item .fmi-mg-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.video-thumbnail-item .fmi-mg-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Video play overlay */
.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.video-card:hover .video-play-overlay {
  opacity: 1;
}

.video-play-overlay svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}

.video-card:hover .video-play-overlay svg {
  transform: scale(1.1);
}

/* Video Modal Styles */
.fmi-video-player-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.fmi-video-player-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 95vh;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.fmi-video-player-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fmi-video-player-close:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

#modalVideoPlayer {
  width: 100%;
  height: auto;
  max-height: 95vh;
  background: #000;
}

/* Ensure proper video thumbnail aspect ratio */
.video-thumbnail-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Mobile responsiveness for video mode */
@media (max-width: 768px) {
  .fmi-mg-wrap[data-content-type="video"] .fmi-mg-hero-overlay {
    padding: 40px 20px;
  }
  
  .fmi-mg-hero-subtitle {
    font-size: 1rem;
  }
  
  .fmi-video-player-content {
    width: 95%;
    border-radius: 4px;
  }
  
  .fmi-video-player-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}

/* ============================================================
   FMI Gallery - Aspect Ratio Navigation
   Plain gray text, right-aligned, cyan hover
   ============================================================ */

/* Aspect Ratio Navigation Container */
/* Aspect nav styles moved to end of file */

/* ============================================================
   FMI Gallery - Aspect Ratio Navigation (RIGHT ALIGNED)
   ============================================================ */

.fmi-mg-aspect-nav {
  padding: 15px 0 0 0 !important;
  margin: 0 6% 20px 6% !important;
  display: flex !important;
  justify-content: stretch !important;
  align-items: center !important;
  border-top: 1px solid #888888 !important;
}

.fmi-mg-aspect-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0 !important;
  width: 100% !important;
  flex-grow: 1 !important;
}

.fmi-mg-left-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Right group: aspect buttons stay tight together */
.fmi-mg-aspect-group {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  flex-shrink: 0;
  margin-left: auto; /* pushes right when left-group is hidden */
}

/* Lightbox nav button — pill outline, pushed to far right of category row */
button.fmi-mg-lightbox-nav-btn {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: 2px solid #1a1a1a !important;
  border-radius: 50px !important;
  padding: 6px 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Poppins', sans-serif !important;
  color: #1a1a1a !important;
  cursor: pointer !important;
  transition: background 0.2s ease, color 0.2s ease !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
  align-self: center !important;
}

button.fmi-mg-lightbox-nav-btn:hover,
button.fmi-mg-lightbox-nav-btn:focus {
  background: #1a1a1a !important;
  color: #ffffff !important;
  outline: none !important;
}

/* Button reset - make buttons look exactly like text */
button.fmi-mg-aspect-btn {
  /* Full reset */
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  
  /* Remove selection/highlight */
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  
  /* Typography */
  padding: 4px 8px !important;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  font-family: 'Poppins', sans-serif !important;
  color: #888888 !important;
  line-height: 1.4 !important;
  text-transform: capitalize !important;
  text-decoration: none !important;
  
  /* Interaction */
  cursor: pointer !important;
  transition: color 0.2s ease !important;
}

button.fmi-mg-aspect-btn:hover,
button.fmi-mg-aspect-btn:focus,
button.fmi-mg-aspect-btn:focus-visible {
  color: #bfacd1 !important;
  background: transparent !important;
  background-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

button.fmi-mg-aspect-btn:active {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

button.fmi-mg-aspect-btn.active {
  color: #bfacd1 !important;
  font-weight: 500 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.fmi-mg-aspect-divider {
  color: #888888 !important;
  font-size: 12px !important;
  font-weight: 300 !important;
  font-family: 'Poppins', sans-serif !important;
  padding: 0 !important;
  margin: 0 4px !important;
  user-select: none !important;
}

/* Mobile responsive for aspect nav */
@media (max-width: 768px) {
  .fmi-mg-aspect-nav {
    justify-content: stretch !important;
    margin-bottom: 15px !important;
  }

  /* Two-line layout: Browse|Search top, All|Landscape|Square|Portrait bottom */
  .fmi-mg-aspect-row {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    row-gap: 8px !important;
  }

  /* Left group (Browse + Search) takes full top line */
  .fmi-mg-search-wrap {
    order: 1;
  }
  .fmi-mg-browse-all-link {
    order: 0;
  }

  /* Aspect buttons pushed to second line, centered */
  button.fmi-mg-aspect-btn,
  .fmi-mg-aspect-divider {
    order: 2;
  }

  /* Second line: center the aspect buttons */
  .fmi-mg-aspect-row::after {
    content: '';
    width: 100%;
    order: 2;
  }

  button.fmi-mg-aspect-btn {
    padding: 4px 6px !important;
    font-size: 12px !important;
  }

  .fmi-mg-search-input {
    width: 120px !important;
  }
}

@media (max-width: 500px) {
  button.fmi-mg-aspect-btn {
    padding: 3px 5px !important;
    font-size: 11px !important;
  }
  .fmi-mg-search-input {
    width: 100px !important;
  }
}

/* ============================================================
   HEADER AVATAR PADDING FIX
   ============================================================ */

/* Fix avatar icon padding - match original site spacing */
.fmi-header-left,
.asv-header-left {
  padding-left: 20px;
  padding-top: 20px;
}

.fmi-header .avatar-circle-wrapper,
.asv-header .avatar-circle-wrapper {
  margin-left: 10px;
}

/* ============================================================
   DELETE REASON DIALOG — v2.1.120
   ============================================================ */

.fmi-delete-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fmi-delete-dialog {
  background: #fff;
  border-radius: 10px;
  width: 380px;
  max-width: 94vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.32);
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
}

.fmi-delete-dialog-header {
  background: var(--hero-purple, #71559c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.fmi-delete-dialog-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fmi-delete-dialog-cancel-x {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.fmi-delete-dialog-cancel-x:hover { opacity: 1; }

.fmi-delete-dialog-thumb {
  padding: 14px 18px 0;
}
.fmi-delete-dialog-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.fmi-delete-dialog-body {
  padding: 16px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fmi-delete-label {
  font-size: 12px;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
  display: block;
}

.fmi-delete-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #999;
}

.fmi-delete-select,
.fmi-delete-note {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: #222;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.fmi-delete-select:focus,
.fmi-delete-note:focus {
  outline: none;
  border-color: var(--hero-purple, #71559c);
}
.fmi-delete-note { resize: vertical; }

.fmi-delete-dialog-footer {
  padding: 12px 18px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fmi-delete-btn-cancel,
.fmi-delete-btn-confirm {
  padding: 8px 20px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.fmi-delete-btn-cancel {
  background: #eee;
  color: #444;
}
.fmi-delete-btn-cancel:hover { background: #e0e0e0; }
.fmi-delete-btn-confirm {
  background: #c0392b;
  color: #fff;
}
.fmi-delete-btn-confirm:hover { opacity: 0.88; }
.fmi-delete-btn-confirm:disabled { opacity: 0.55; cursor: not-allowed; }

/* ============================================================
   v2.1.189 — Browse Index Grid
   5-column square-tile category overview loaded into .fmi-mg-grid
   ============================================================ */

/* Override masonry when in browse-index mode */
.fmi-mg-grid.fmi-mg-browse-index-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
}

/* Each category tile */
.fmi-mg-browse-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.fmi-mg-browse-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}

/* Square image container — always 1:1 */
.fmi-mg-browse-tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e8e8e8;
  flex-shrink: 0;
}

.fmi-mg-browse-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}

.fmi-mg-browse-tile:hover .fmi-mg-browse-tile-img img {
  transform: scale(1.04);
}

/* Category label below tile */
.fmi-mg-browse-tile-label {
  width: 100%;
  padding: 7px 8px 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* Mobile: 2 columns on small screens */
@media (max-width: 600px) {
  .fmi-mg-grid.fmi-mg-browse-index-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* Tablet: 3 columns */
@media (min-width: 601px) and (max-width: 900px) {
  .fmi-mg-grid.fmi-mg-browse-index-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
}

/* v2.1.191 — Search bar removed from left-group; Browse button replaces it */
.fmi-mg-search-wrap {
  display: none !important;
}

/* v2.1.191 — Browse index button styling (matches Refresh/aspect-btn look) */
.fmi-mg-browse-index-btn {
  font-size: 12px;
  font-weight: 400;
  font-family: 'Poppins', sans-serif;
  color: #888888;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s ease;
  padding: 4px 8px;
  text-transform: capitalize;
  display: inline-block;
}
.fmi-mg-browse-index-btn:hover {
  color: #bfacd1;
}
.fmi-mg-browse-index-btn.active {
  color: #bfacd1;
  font-weight: 500;
}

/* v2.1.192 — Hard overrides: ensure browse tiles are always square regardless of masonry resets */
.fmi-mg-grid.fmi-mg-browse-index-grid .fmi-mg-browse-tile {
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
}

.fmi-mg-grid.fmi-mg-browse-index-grid .fmi-mg-browse-tile-img {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  height: auto !important;
  min-height: 0 !important;
}

.fmi-mg-grid.fmi-mg-browse-index-grid .fmi-mg-browse-tile-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  aspect-ratio: auto !important;
  max-width: none !important;
  max-height: none !important;
}
