/**
 * Zafer Emlak - Custom Styles
 * Additional styles that complement Tailwind CSS
 */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #d60000;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8a0000;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Line clamp utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-slow {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounce-slow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out;
}

.animate-slideUp {
  animation: slideUp 0.4s ease-out;
}

.animate-pulse-slow {
  animation: pulse-slow 2s ease-in-out infinite;
}

.animate-bounce-slow {
  animation: bounce-slow 2s ease-in-out infinite;
}

/* Property Card Hover Effects */
.property-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.property-card:hover {
  transform: translateY(-4px);
}

/* Toast Notifications */
.toast {
  animation:
    slideIn 0.3s ease-out,
    fadeIn 0.3s ease-out;
}

.toast-success {
  background-color: #10b981;
  color: white;
}

.toast-error {
  background-color: #ef4444;
  color: white;
}

.toast-info {
  background-color: #3b82f6;
  color: white;
}

.toast-warning {
  background-color: #f59e0b;
  color: white;
}

/* Form Focus States */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d60000;
  box-shadow: 0 0 0 3px rgba(214, 0, 0, 0.1);
}

/* Button Active States */
button:active {
  transform: scale(0.98);
}

/* Image Placeholder */
.image-placeholder {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Featured Badge Glow */
.featured-badge {
  animation: pulse-slow 2s ease-in-out infinite;
}

/* Favorite Button Active State */
.favorite-btn.active i {
  fill: #ef4444;
  color: #ef4444;
}

/* Compare Button Active State */
.compare-btn.active i {
  fill: #ffcc00;
  color: #ffcc00;
}

/* Print Styles */
@media print {
  header,
  footer,
  .no-print,
  #scrollToTop,
  #compareBar,
  .whatsapp-btn {
    display: none !important;
  }

  body {
    background: white !important;
  }

  .property-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e5e7eb;
  }
}

/* Mobile Menu Animation */
#mobileMenu {
  transition: max-height 0.3s ease-out;
  max-height: 0;
  overflow: hidden;
}

#mobileMenu.open {
  max-height: 500px;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Modal Backdrop Blur */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

/* Carousel Styles */
.carousel-container {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-out;
}

.carousel-item {
  flex-shrink: 0;
}

/* Price Badge */
.price-badge {
  background: linear-gradient(135deg, #d60000 0%, #8a0000 100%);
}

/* Category Pills */
.category-pill {
  transition: all 0.2s ease;
}

.category-pill:hover {
  transform: scale(1.05);
}

.category-pill.active {
  background-color: #d60000;
  color: white;
}

/* Image Gallery */
.gallery-thumb {
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
  cursor: pointer;
}

.gallery-thumb:hover {
  opacity: 0.8;
}

.gallery-thumb.active {
  border-color: #d60000;
  opacity: 1;
}

/* Sticky Header Shadow */
header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Filter Sidebar Mobile */
@media (max-width: 1023px) {
  .filter-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
    overflow-y: auto;
  }

  .filter-sidebar.open {
    transform: translateX(0);
  }

  .filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  .filter-overlay.open {
    opacity: 1;
    visibility: visible;
  }
}

/* Custom Select Arrow */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Range Input Styling */
input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #d60000;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Checkbox Custom Styling */
input[type='checkbox'] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type='checkbox']:checked {
  background-color: #d60000;
  border-color: #d60000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d60000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #1f2937;
  color: white;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}
