/* ATLAS Touch-Friendly Mobile Components - Phase 3 Day 1 */

/* ================================
   TOUCH-FRIENDLY INTERACTIONS
   ================================ */

/* Base Touch Targets */
.atlas-touch-target {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile-First Buttons */
.atlas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--button-height);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Button Variants */
.atlas-btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(204, 0, 0, 0.2);
}

.atlas-btn-primary:hover,
.atlas-btn-primary:focus {
  background: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(204, 0, 0, 0.3);
  transform: translateY(-1px);
}

.atlas-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(204, 0, 0, 0.2);
}

.atlas-btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.atlas-btn-secondary:hover,
.atlas-btn-secondary:focus {
  background: var(--primary-color);
  color: white;
}

.atlas-btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.atlas-btn-ghost:hover,
.atlas-btn-ghost:focus {
  background: var(--bg-light);
  border-color: var(--primary-color);
}

/* Button Sizes */
.atlas-btn-sm {
  min-height: 36px;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
}

.atlas-btn-lg {
  min-height: 56px;
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--text-lg);
}

.atlas-btn-full {
  width: 100%;
}

/* ================================
   TOUCH-OPTIMIZED FORMS
   ================================ */

/* Mobile-First Form Controls */
.atlas-input {
  width: 100%;
  min-height: var(--input-height);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-base);
  background: white;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.atlas-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.atlas-input::placeholder {
  color: var(--text-secondary);
}

/* Select Dropdown */
.atlas-select {
  position: relative;
  display: block;
  width: 100%;
}

.atlas-select select {
  width: 100%;
  min-height: var(--input-height);
  padding: var(--space-sm) var(--space-2xl) var(--space-sm) var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-base);
  background: white;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.atlas-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: var(--space-md);
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--text-secondary);
  pointer-events: none;
}

/* Textarea */
.atlas-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-base);
  background: white;
  resize: vertical;
  transition: all 0.2s ease;
}

.atlas-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

/* Form Groups */
.atlas-form-group {
  margin-bottom: var(--space-lg);
}

.atlas-form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.atlas-form-error {
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  color: #e74c3c;
}

/* ================================
   MOBILE NAVIGATION
   ================================ */

/* Mobile Menu Toggle */
.atlas-mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.atlas-mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Dark mode görünürlüğü artır */
body.dark-mode .atlas-mobile-menu-toggle {
  color: #f9fafb;
}

.atlas-mobile-menu-toggle span:nth-child(1) {
  margin-bottom: 4px;
}

.atlas-mobile-menu-toggle span:nth-child(3) {
  margin-top: 4px;
}

/* Hamburger Animation */
.atlas-mobile-menu-toggle.atlas-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.atlas-mobile-menu-toggle.atlas-active span:nth-child(2) {
  opacity: 0;
}

.atlas-mobile-menu-toggle.atlas-active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation Menu */
.atlas-mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: calc(var(--z-fixed, 1000) + 20);
  transition: left 0.3s ease;
  overflow-y: auto;
  display: none; /* Desktop'ta gizle */
  flex-direction: column;
}

/* Desktop'ta mobile navigation'ı tamamen gizle */
@media (min-width: 769px) {
  .atlas-mobile-nav {
    display: none !important;
  }
}

/* Mobile'da göster */
@media (max-width: 768px) {
  .atlas-mobile-nav {
    display: flex !important;
  }
}

.atlas-mobile-nav.atlas-active {
  left: 0;
}

.atlas-mobile-nav-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.atlas-mobile-nav-header {
  padding: var(--space-lg, 16px);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 60px;
}

.atlas-mobile-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: var(--primary-color, #cc0000);
  font-size: 16px;
  font-family: 'Poppins', Arial, sans-serif;
}

.atlas-mobile-nav-logo span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.atlas-mobile-nav-logo-img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.atlas-mobile-nav-close {
  width: var(--touch-target, 44px);
  height: var(--touch-target, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 20px;
  color: var(--text-secondary, #6b7280);
  -webkit-tap-highlight-color: transparent;
}

.atlas-mobile-nav-close:hover,
.atlas-mobile-nav-close:focus {
  background: var(--bg-light, #f3f4f6);
  color: var(--primary-color, #cc0000);
  transform: scale(1.05);
}

.atlas-mobile-nav-close:hover {
  background: var(--bg-light, #f3f4f6);
}

.atlas-mobile-nav-menu {
  flex: 1;
  padding: var(--space-md, 12px) 0;
}

.atlas-mobile-nav-item {
  display: block;
  padding: var(--space-md, 12px) var(--space-lg, 16px);
  color: var(--text-primary, #374151);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: var(--touch-target, 44px);
  display: flex;
  align-items: center;
  gap: var(--space-md, 12px);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.atlas-mobile-nav-item:hover,
.atlas-mobile-nav-item:focus {
  background: var(--bg-light, #f3f4f6);
  color: var(--primary-color, #cc0000);
}

.atlas-mobile-nav-item.active {
  background: rgba(204, 0, 0, 0.1);
  color: var(--primary-color, #cc0000);
  font-weight: 600;
}

.atlas-mobile-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.atlas-mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.atlas-mobile-nav-link {
  display: block;
  padding: var(--space-lg, 16px);
  color: var(--text-primary, #374151);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: var(--touch-target, 44px);
  display: flex;
  align-items: center;
  gap: var(--space-md, 12px);
}

.atlas-mobile-nav-link:hover,
.atlas-mobile-nav-link:focus {
  background: var(--bg-light);
  color: var(--primary-color);
}

/* Mobile Overlay - COMPLETELY DISABLED */
.atlas-mobile-overlay {
  display: none !important; /* Overlay'i tamamen kaldır */
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

.atlas-mobile-nav.atlas-active .atlas-mobile-overlay {
  display: none !important; /* Active durumda da gizle */
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ================================
   TOUCH GESTURES & INTERACTIONS
   ================================ */

/* Swipe Indicators */
.atlas-swipeable {
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.atlas-swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.atlas-swipe-indicator.atlas-left {
  left: var(--space-md);
}

.atlas-swipe-indicator.atlas-right {
  right: var(--space-md);
}

.atlas-swipeable:hover .atlas-swipe-indicator {
  opacity: 1;
}

/* Pull to Refresh */
.atlas-pull-to-refresh {
  position: relative;
  overflow: hidden;
}

.atlas-pull-indicator {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top 0.3s ease;
}

.atlas-pull-to-refresh.atlas-pulling .atlas-pull-indicator {
  top: var(--space-md);
}

/* ================================
   RESPONSIVE CARD COMPONENTS
   ================================ */

/* Mobile-First Cards */
.atlas-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.atlas-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.atlas-card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.atlas-card-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.atlas-card-body {
  padding: var(--space-lg);
}

.atlas-card-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
  background: var(--bg-light);
}

/* Property Card Mobile Optimizations */
.property-card {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Mobile: Stack content vertically */
.property-card {
  display: flex;
  flex-direction: column;
}

.property-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.property-card:hover .property-card-image img {
  transform: scale(1.05);
}

.property-card-content {
  padding: var(--space-lg);
  flex: 1;
}

.property-card-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--space-sm);
}

.property-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-card-location {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.property-card-features {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.property-card-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Tablet+ Horizontal Layout */
@media (min-width: 768px) {
  .property-card-horizontal {
    flex-direction: row;
    min-height: 200px;
  }
  
  .property-card-horizontal .property-card-image {
    width: 300px;
    height: auto;
  }
  
  .property-card-horizontal .property-card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

/* ================================
   ACCESSIBILITY & FOCUS MANAGEMENT
   ================================ */

/* Focus Visible for Touch Devices */
.atlas-focus-visible:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip Link for Accessibility */
.atlas-skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  transition: top 0.3s;
  z-index: var(--z-tooltip);
}

.atlas-skip-link:focus {
  top: 6px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================
   MOBILE HEADER & LOGO FIXES
   ================================ */

@media (max-width: 768px) {
  /* Header optimizations for mobile */
  header {
    padding: 0 !important;
  }
  
  header nav {
    padding: 0.3rem 1rem !important;
    min-height: 50px !important;
  }
  
  header.scrolled nav {
    padding: 0.2rem 1rem !important;
    min-height: 45px !important;
  }
  
  /* Logo size fixes for mobile */
  .logo {
    margin-right: 1rem !important;
  }
  
  .logo-img {
    height: 30px !important;
    margin-right: 6px !important;
  }
  
  .admin-logo-img {
    height: 28px !important;
    margin-right: 6px !important;
  }
  
  .logo h1 {
    font-size: 0.9rem !important;
    letter-spacing: 0.5px !important;
  }
  
  header.scrolled .logo h1 {
    font-size: 0.8rem !important;
  }
  
  /* Hide desktop navigation on mobile */
  .nav-links {
    display: none !important;
  }
  
  /* Show mobile hamburger button */
  .atlas-mobile-menu-toggle {
    display: flex !important;
    position: relative;
    z-index: 1001;
  }
  
  /* Categories container mobile fix */
  .category-container {
    padding: 1rem !important;
    margin: 0.5rem !important;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .category-item {
    padding: 0.8rem !important;
    font-size: 0.9rem !important;
  }
  
  .category-item i {
    font-size: 1.2rem !important;
    margin-bottom: 0.3rem !important;
  }
}

/* Desktop'ta hamburger butonunu gizle */
@media (min-width: 769px) {
  .atlas-mobile-menu-toggle {
    display: none !important;
  }
}
