/**
 * Custom Cursor Styles
 * Dr. Yıldız Digital Ecosystem
 * 
 * Styles for the custom branded cursor that creates a premium
 * interactive experience with smooth following and hover state variations.
 * 
 * Requirements: 29.1, 29.2, 29.5
 */

/* ============================================
 * CUSTOM CURSOR BASE STYLES
 * ============================================ */

.custom-cursor {
  /* Fixed positioning to follow mouse */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  
  /* Prevent cursor from blocking interactions */
  pointer-events: none;
  
  /* Initial hidden state */
  opacity: 0;
  
  /* Enable GPU acceleration for smooth transforms */
  will-change: transform, width, height, opacity;
  
  /* Smooth transitions for size and opacity changes */
  transition: 
    width 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
    height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    mix-blend-mode 0.2s ease;
}

/* Main cursor dot */
.custom-cursor__dot {
  /* Small circle - branded cursor */
  width: 12px;
  height: 12px;
  border-radius: 50%;
  
  /* Brand primary color with transparency */
  background-color: var(--color-primary, #f03167);
  
  /* Center the dot */
  transform: translate(-50%, -50%);
  
  /* Smooth transitions */
  transition: 
    width 0.15s cubic-bezier(0.25, 0.1, 0.25, 1),
    height 0.15s cubic-bezier(0.25, 0.1, 0.25, 1),
    background-color 0.15s ease,
    opacity 0.15s ease;
}

/* Outer ring for hover states */
.custom-cursor__ring {
  /* Larger ring around the dot */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  
  /* Transparent with border */
  background-color: transparent;
  border: 1px solid var(--color-primary, #f03167);
  opacity: 0;
  
  /* Center the ring */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  
  /* Smooth transitions */
  transition: 
    width 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
    height 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
    border-color 0.25s ease;
}

/* ============================================
 * CURSOR VISIBLE STATE
 * ============================================ */

.custom-cursor.is-visible {
  opacity: 1;
}

/* ============================================
 * CURSOR HOVER STATES
 * Requirements: 29.2 - Grow on links, blend mode on cards
 * ============================================ */

/* Hover over links - grow cursor */
.custom-cursor.is-hovering-link .custom-cursor__dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-primary, #f03167);
}

.custom-cursor.is-hovering-link .custom-cursor__ring {
  opacity: 0.6;
  transform: translate(-50%, -50%) scale(1);
  width: 48px;
  height: 48px;
}

/* Hover over buttons - larger grow effect */
.custom-cursor.is-hovering-button .custom-cursor__dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-white, #ffffff);
}

.custom-cursor.is-hovering-button .custom-cursor__ring {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1);
  width: 56px;
  height: 56px;
  border-color: var(--color-white, #ffffff);
}

/* Hover over cards - blend mode effect */
.custom-cursor.is-hovering-card .custom-cursor__dot {
  width: 60px;
  height: 60px;
  background-color: var(--color-primary, #f03167);
  opacity: 0.3;
  mix-blend-mode: difference;
}

.custom-cursor.is-hovering-card .custom-cursor__ring {
  opacity: 0;
}

/* Hover over images - zoom indicator */
.custom-cursor.is-hovering-image .custom-cursor__dot {
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
}

.custom-cursor.is-hovering-image .custom-cursor__ring {
  opacity: 0.5;
  transform: translate(-50%, -50%) scale(1);
  width: 80px;
  height: 80px;
  border-color: var(--color-white, #ffffff);
}

/* Hover over text inputs - text cursor indicator */
.custom-cursor.is-hovering-input .custom-cursor__dot {
  width: 2px;
  height: 24px;
  border-radius: 1px;
  background-color: var(--color-primary, #f03167);
}

.custom-cursor.is-hovering-input .custom-cursor__ring {
  opacity: 0;
}

/* ============================================
 * CURSOR CLICK STATE
 * Requirements: 29.5 - Subtle feedback through scale
 * ============================================ */

.custom-cursor.is-clicking .custom-cursor__dot {
  transform: translate(-50%, -50%) scale(0.8);
}

.custom-cursor.is-clicking .custom-cursor__ring {
  transform: translate(-50%, -50%) scale(0.9);
}

/* ============================================
 * CURSOR HIDDEN STATE
 * For when cursor leaves viewport or on specific elements
 * ============================================ */

.custom-cursor.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ============================================
 * HIDE DEFAULT CURSOR
 * Applied to body when custom cursor is active
 * ============================================ */

body.has-custom-cursor {
  cursor: none;
}

body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor input,
body.has-custom-cursor textarea,
body.has-custom-cursor select,
body.has-custom-cursor [role="button"],
body.has-custom-cursor .btn,
body.has-custom-cursor .card,
body.has-custom-cursor .treatment-card,
body.has-custom-cursor .article-card,
body.has-custom-cursor .protocol-card {
  cursor: none;
}

/* ============================================
 * REDUCED MOTION SUPPORT
 * Disable custom cursor for users who prefer reduced motion
 * ============================================ */

@media (prefers-reduced-motion: reduce) {
  .custom-cursor {
    display: none !important;
  }
  
  body.has-custom-cursor {
    cursor: auto;
  }
  
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor textarea,
  body.has-custom-cursor select,
  body.has-custom-cursor [role="button"],
  body.has-custom-cursor .btn,
  body.has-custom-cursor .card {
    cursor: auto;
  }
}

/* ============================================
 * TOUCH DEVICE HANDLING
 * Hide custom cursor on touch devices
 * ============================================ */

@media (hover: none) and (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }
  
  body.has-custom-cursor {
    cursor: auto;
  }
  
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor textarea,
  body.has-custom-cursor select,
  body.has-custom-cursor [role="button"],
  body.has-custom-cursor .btn,
  body.has-custom-cursor .card {
    cursor: auto;
  }
}

/* ============================================
 * MOBILE BREAKPOINT
 * Hide custom cursor on smaller screens
 * ============================================ */

@media (max-width: 768px) {
  .custom-cursor {
    display: none !important;
  }
  
  body.has-custom-cursor {
    cursor: auto;
  }
  
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor textarea,
  body.has-custom-cursor select,
  body.has-custom-cursor [role="button"],
  body.has-custom-cursor .btn,
  body.has-custom-cursor .card {
    cursor: auto;
  }
}
