/* IITM Annotation Extension Styles (V10 Mobile & Touch Support) */

:root {
  --iitm-primary: #4f46e5;
  --iitm-accent: #6366f1;
  --bg-blur: rgba(255, 255, 255, 0.85); /* Premium Glass */
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --z-overlay: 10000000; 
  --z-toolbar: 2147483647; 
}

.iitm-whiteboard-overlay {
  position: absolute; 
  top: 0;
  left: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  touch-action: none;
  background: transparent;
  overflow: hidden; /* 🚩 HYPER-ACCURACY: Prevent any horizontal overflow */
  max-width: 100vw;
}

.iitm-whiteboard-overlay.pro {
  position: fixed !important;
  width: 100vw !important;
  height: 100vh !important;
}

.iitm-whiteboard-canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  background: transparent;
  /* 🚩 TOUCH LOCK: Prevent scrolling/panning during drawing */
  touch-action: none; 
}

.iitm-canvas-static {
  z-index: 1;
  pointer-events: none; /* No interaction for finalized shapes */
}

.iitm-canvas-dynamic {
  z-index: 2;
  pointer-events: auto; /* Catch active drawing */
}

/* Floating Toolbar V10 (Responsive) */
.iitm-annotation-toolbar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-blur);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 10px 20px;
  border-radius: 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-premium);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: var(--z-toolbar);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  /* 🚩 Horizontal Scroll Support */
  max-width: 90vw;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
}

.iitm-annotation-toolbar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.iitm-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.iitm-tool-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  flex-shrink: 0;
}

.iitm-tool-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--iitm-primary);
}

.iitm-tool-btn.active {
  background: var(--iitm-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Color Dots */
.iitm-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 1);
  flex-shrink: 0;
}

.iitm-color-dot:hover {
  transform: scale(1.2);
}

.iitm-color-dot.active {
  border-color: #64748b;
  transform: scale(1.25);
}

.iitm-divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 6px;
  flex-shrink: 0;
}


/* 🚩 MOBILE BREAKPOINTS */
@media (max-width: 768px) {
  .iitm-annotation-toolbar {
    bottom: 20px;
    padding: 8px 16px;
    gap: 8px;
    border-radius: 20px;
  }
  
  .iitm-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  
  .iitm-color-dot {
    width: 22px;
    height: 22px;
  }
  
  .iitm-toggle-fab {
    width: 38px !important; 
    height: 38px !important;
    bottom: 15vh !important;  
    right: 2vw !important;
  }
  .iitm-toggle-fab svg {
    width: 20px !important;
    height: 20px !important;
  }
}

@media (max-width: 480px) {
  .iitm-annotation-toolbar {
    padding: 6px 12px;
    gap: 6px;
    bottom: 15px;
    max-width: 95vw;
  }
  
  .iitm-tool-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  
  .iitm-toggle-fab {
    width: 32px !important;  /* 🚩 Correct compact size */
    height: 32px !important;
    bottom: 15vh !important; 
    right: 2vw !important;
  }
  
  .iitm-toggle-fab svg {
    width: 18px !important;   /* 🚩 Scale the internal icon too */
    height: 18px !important;
  }
}

/* FAB Toggle V10 */
.iitm-toggle-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--iitm-primary);
  color: white;
  border: none;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  z-index: var(--z-toolbar);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-out;
}

.iitm-toggle-fab:hover {
  transform: scale(1.05);
  background: var(--iitm-accent);
}

.hidden {
  display: none !important;
}

@media print {
  .iitm-annotation-toolbar, .iitm-toggle-fab {
    display: none !important;
  }
}
