/*
 * SVG Icon Styles for PropertyWebBuilder
 * Using Lucide Icons (https://lucide.dev)
 *
 * This replaces the Material Symbols font-based icons.
 * Use the icon(:name) helper to render icons.
 */

/* ============================================
 * Base Icon Styles
 * ============================================ */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ============================================
 * Size Variants
 * ============================================
 * Matching the old Material Symbols sizes:
 * :xs (14px), :sm (18px), :md (24px), :lg (36px), :xl (48px)
 */

.icon-xs {
  width: 14px;
  height: 14px;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon-md {
  width: 24px;
  height: 24px;
}

.icon-lg {
  width: 36px;
  height: 36px;
}

.icon-xl {
  width: 48px;
  height: 48px;
}

/* ============================================
 * Style Variants
 * ============================================ */

/* Filled variant - changes stroke to fill */
.icon-filled {
  fill: currentColor;
  stroke: none;
}

/* Thicker stroke for emphasis */
.icon-bold {
  stroke-width: 2.5;
}

/* Thinner stroke for subtle icons */
.icon-light {
  stroke-width: 1.5;
}

/* ============================================
 * Utility Classes
 * ============================================ */

/* Fixed width for alignment in lists */
.icon-fw {
  width: 1.5em;
  text-align: center;
}

/* Spin animation for loading states */
.icon-spin {
  animation: icon-spin 1s linear infinite;
}

@keyframes icon-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pulse animation */
.icon-pulse {
  animation: icon-pulse 1s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
 * Icon Button Component
 * ============================================ */

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.icon-button:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.icon-button:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.icon-button:active {
  background-color: rgba(0, 0, 0, 0.12);
}

/* ============================================
 * Brand Icons (SVG)
 * ============================================ */

.brand-icon {
  display: inline-block;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
}

/* Social link styling */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.15s ease-in-out;
  color: inherit;
  text-decoration: none;
}

.social-link:hover {
  transform: scale(1.1);
}

/* Platform-specific colors on hover */
.social-link-facebook:hover { color: #1877F2; }
.social-link-instagram:hover { color: #E4405F; }
.social-link-linkedin:hover { color: #0A66C2; }
.social-link-youtube:hover { color: #FF0000; }
.social-link-twitter:hover,
.social-link-x:hover { color: #000000; }
.social-link-whatsapp:hover { color: #25D366; }
.social-link-pinterest:hover { color: #BD081C; }
.social-link-tiktok:hover { color: #000000; }

/* Social icons in colored circles */
.social-icons-colored .social-link {
  color: white;
}

.social-icons-colored .social-link-facebook { background-color: #1877F2; }
.social-icons-colored .social-link-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.social-icons-colored .social-link-linkedin { background-color: #0A66C2; }
.social-icons-colored .social-link-youtube { background-color: #FF0000; }
.social-icons-colored .social-link-twitter,
.social-icons-colored .social-link-x { background-color: #000000; }
.social-icons-colored .social-link-whatsapp { background-color: #25D366; }
.social-icons-colored .social-link-pinterest { background-color: #BD081C; }

/* ============================================
 * Contextual Icon Styling
 * ============================================ */

/* Property feature icons */
.property-feature-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.25rem;
  color: var(--text-muted, #6b7280);
}

/* Navigation icons */
.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

/* Action button icons */
.btn .icon {
  margin-right: 0.375rem;
}

.btn-icon-only .icon {
  margin-right: 0;
}

/* Form input icons */
.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #6b7280);
  pointer-events: none;
}

.input-with-icon {
  padding-left: 2.5rem;
}

/* ============================================
 * Accessibility
 * ============================================ */

/* Ensure icons don't interfere with screen readers when decorative */
.icon[aria-hidden="true"],
.brand-icon[aria-hidden="true"] {
  speak: never;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .icon,
  .brand-icon {
    forced-color-adjust: auto;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .icon-spin,
  .icon-pulse {
    animation: none;
  }
}

/* ============================================
 * Legacy Compatibility
 * ============================================
 * These classes map old Material Symbols classes to new SVG styles
 * for any templates that haven't been updated yet.
 */

.material-symbols-outlined {
  /* Fallback: if old class is used, apply icon base styles */
  display: inline-block;
  vertical-align: middle;
}

/* Size mappings for old classes */
.md-14 { font-size: 14px; }
.md-18 { font-size: 18px; }
.md-24 { font-size: 24px; }
.md-36 { font-size: 36px; }
.md-48 { font-size: 48px; }
