/* ============================================
   DESIGN SYSTEM - Yiğit Yapı Market
   Color Palette: Blue, White, Black
   ============================================ */

:root {
  /* Primary Colors */
  --blue-900: #0a1628;
  --blue-800: #0d2240;
  --blue-700: #0f3460;
  --blue-600: #1a4a8a;
  --blue-500: #1e5faa;
  --blue-400: #3b82d6;
  --blue-300: #6ba3e8;
  --blue-200: #a0c4f1;
  --blue-100: #dae8fa;
  --blue-50: #eef4fc;

  /* Neutral Colors */
  --black: #000000;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;

  /* Accent */
  --accent-gold: #f5a623;
  --accent-green: #10b981;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-blue: 0 4px 24px rgba(30, 95, 170, 0.2);
  --shadow-glow: 0 0 40px rgba(30, 95, 170, 0.15);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-primary: 'Outfit', sans-serif;
  --font-secondary: 'Inter', sans-serif;

  /* Spacing */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  background: var(--blue-900);
  background: linear-gradient(160deg, var(--blue-900) 0%, #0b1d3a 40%, #091428 100%);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  color: var(--gray-800);
  overflow-x: hidden;
  position: relative;
}

/* ============================================
   PARTICLES CANVAS
   ============================================ */

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: containerSlideUp 0.8s var(--transition-smooth) both;
}

@keyframes containerSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   BANNER SECTION
   ============================================ */

.banner-section {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: var(--blue-500);
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* ============================================
   PROFILE SECTION
   ============================================ */

.profile-section {
  text-align: center;
  padding: 0 24px 10px;
  position: relative;
  background: var(--white);
}

.profile-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-top: -55px;
  margin-bottom: 10px;
  background: var(--white);
}

.company-name {
  font-family: var(--font-primary);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--blue-900);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.location-link {
  display: inline-block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color var(--transition-fast);
  line-height: 1.4;
  padding: 0 10px;
}

.location-link i {
  color: var(--blue-500);
  font-size: 0.8rem;
  margin-right: 6px;
}

.location-link:hover {
  color: var(--blue-500);
}

/* ============================================
   SOCIAL ICONS
   ============================================ */

.social-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 4px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
}

.social-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: inherit;
}

.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue);
  border-color: transparent;
}

.social-icon:hover::before {
  opacity: 1;
}

.social-icon i {
  position: relative;
  z-index: 1;
  transition: color var(--transition-fast);
}

.social-icon:hover i {
  color: var(--white);
}

/* ============================================
   SECTION DIVIDER
   ============================================ */

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--white);
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-200), transparent);
}

.divider-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-400);
  font-size: 12px;
  border: 1px solid var(--blue-100);
}

/* ============================================
   BUTTONS SECTION
   ============================================ */

.buttons-section {
  padding: 4px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--white);
  position: relative;
}

/* Main Buttons */
.main-buttons {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.main-buttons-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.buttons-section.catalog-active .main-buttons {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--gray-800);
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  font-family: var(--font-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
}

.action-button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  transition: width var(--transition-smooth);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.action-button:hover {
  border-color: var(--blue-200);
  background: var(--blue-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
}

.action-button:hover::before {
  width: 4px;
}

.action-button:active {
  transform: translateY(0);
}

.button-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  transition: all var(--transition-smooth);
  position: relative;
  z-index: 1;
}

.phone-icon {
  background: linear-gradient(135deg, #e3f0ff, #cfe0f7);
  color: var(--blue-600);
}
.location-icon {
  background: linear-gradient(135deg, #fce7f3, #f3d0e7);
  color: #be185d;
}
.website-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: var(--blue-700);
}
.whatsapp-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
}
.email-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}
.catalog-icon {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
}

.button-label {
  flex: 1;
  font-family: var(--font-primary);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.button-arrow {
  font-size: 12px;
  color: var(--gray-400);
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
}

.action-button:hover .button-arrow {
  color: var(--blue-500);
  transform: translateX(3px);
}

/* ============================================
   CATALOG - Slide Up
   ============================================ */

.catalog-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

/* No extra positioning needed for active state */

.catalog-trigger {
  border: 1px solid var(--gray-200);
  outline: none;
  font-family: var(--font-secondary);
  font-size: 0.95rem;
}

.buttons-section.catalog-active .catalog-trigger {
  border-color: var(--blue-300);
  background: var(--blue-50);
}

.catalog-chevron {
  transition: transform var(--transition-smooth) !important;
}

.buttons-section.catalog-active .catalog-chevron {
  transform: rotate(180deg);
}

.catalog-submenu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
}

.catalog-submenu-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.buttons-section.catalog-active .catalog-submenu {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 10px;
}

.catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--blue-700);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  background: var(--blue-50);
  margin-bottom: 6px;
  border: 1px solid var(--blue-100);
}

.catalog-item:last-child {
  margin-bottom: 0;
}

.catalog-item:hover {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  border-color: var(--blue-200);
}

.catalog-brand-logo {
  height: 32px;
  width: auto;
  max-width: 80px;
  border-radius: 4px;
  margin-right: 12px;
  flex-shrink: 0;
  object-fit: contain;
}

.catalog-item-text {
  flex: 1;
}

.catalog-item-arrow {
  font-size: 10px;
  color: var(--blue-400);
  opacity: 0;
  transform: translateX(-5px);
  transition: all var(--transition-fast);
}

.catalog-item:hover .catalog-item-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 16px 24px 20px;
  text-align: center;
  background: var(--white);
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
  margin-bottom: 14px;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-family: var(--font-secondary);
  letter-spacing: 0.02em;
}

/* ============================================
   DEVICE DETECTION
   ============================================ */

.ios-only,
.android-only,
.desktop-only {
  display: none;
}

body.ios .ios-only {
  display: inline;
}

body.android .android-only {
  display: inline;
}

body.desktop .desktop-only {
  display: inline;
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */

.action-button {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeSlideUp 0.5s var(--transition-smooth) forwards;
}

.action-button:nth-child(1) { animation-delay: 0.15s; }
.action-button:nth-child(2) { animation-delay: 0.22s; }
.action-button:nth-child(3) { animation-delay: 0.29s; }
.action-button:nth-child(4) { animation-delay: 0.36s; }
.action-button:nth-child(5) { animation-delay: 0.43s; }

.catalog-wrapper {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeSlideUp 0.5s var(--transition-smooth) forwards;
  animation-delay: 0.50s;
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social-icon {
  opacity: 0;
  transform: scale(0.5) translateY(10px);
  animation: socialPop 0.4s var(--transition-spring) forwards;
}

.social-icon:nth-child(1) { animation-delay: 0.5s; }
.social-icon:nth-child(2) { animation-delay: 0.6s; }
.social-icon:nth-child(3) { animation-delay: 0.7s; }
.social-icon:nth-child(4) { animation-delay: 0.8s; }
.social-icon:nth-child(5) { animation-delay: 0.9s; }

@keyframes socialPop {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.company-name {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.3s;
}

.location-link {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.4s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 520px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .container {
    max-width: 100%;
    border-radius: 0;
    min-height: 100vh;
    box-shadow: none;
  }

  .banner-section {
    height: 120px;
  }

  .buttons-section {
    padding: 4px 16px 24px;
  }

  .profile-section {
    padding: 0 16px 10px;
  }
}

@media (min-width: 521px) {
  body {
    padding: 30px 20px;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--blue-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue-500);
}

/* ============================================
   SELECTION
   ============================================ */

::selection {
  background: var(--blue-200);
  color: var(--blue-900);
}

/* ============================================
   DARK MODE (System Preference)
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --dm-bg: #0b1120;
    --dm-card: #131c2e;
    --dm-card-secondary: #1a2540;
    --dm-border: #243352;
    --dm-border-hover: #2e4470;
    --dm-text: #e8ecf4;
    --dm-text-secondary: #94a3c0;
    --dm-text-muted: #5e7091;
  }

  body {
    background: var(--dm-bg);
    background: linear-gradient(160deg, var(--dm-bg) 0%, #0d1526 40%, #080e1a 100%);
  }

  .container {
    background: var(--dm-card);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 40px rgba(10, 30, 70, 0.2);
  }

  .banner-section {
    background: var(--blue-800);
  }

  /* Profile Section */
  .profile-section {
    background: var(--dm-card);
  }

  .profile-photo {
    border-color: var(--dm-card);
    background: var(--dm-card);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }

  .company-name {
    color: var(--dm-text);
  }

  .location-link {
    color: var(--dm-text-secondary);
  }

  .location-link i {
    color: var(--blue-400);
  }

  .location-link:hover {
    color: var(--blue-300);
  }

  /* Social Icons */
  .social-icon {
    background: var(--dm-card-secondary);
    color: var(--blue-300);
    border-color: var(--dm-border);
  }

  .social-icon::before {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  }

  .social-icon:hover {
    box-shadow: 0 4px 20px rgba(30, 95, 170, 0.3);
    border-color: transparent;
  }

  /* Divider */
  .section-divider {
    background: var(--dm-card);
  }

  .divider-line {
    background: linear-gradient(90deg, transparent, var(--dm-border), transparent);
  }

  .divider-icon {
    background: var(--dm-card-secondary);
    color: var(--blue-400);
    border-color: var(--dm-border);
  }

  /* Buttons Section */
  .buttons-section {
    background: var(--dm-card);
  }

  .action-button {
    background: var(--dm-card-secondary);
    border-color: var(--dm-border);
    color: var(--dm-text);
  }

  .action-button:hover {
    background: #1e2d4a;
    border-color: var(--dm-border-hover);
    box-shadow: 0 4px 20px rgba(30, 95, 170, 0.15);
  }

  .button-arrow {
    color: var(--dm-text-muted);
  }

  .action-button:hover .button-arrow {
    color: var(--blue-400);
  }

  /* Button Icons - Dark Mode */
  .phone-icon {
    background: linear-gradient(135deg, #152a4a, #1a3560);
    color: var(--blue-300);
  }
  .location-icon {
    background: linear-gradient(135deg, #2a1525, #351a30);
    color: #f472b6;
  }
  .website-icon {
    background: linear-gradient(135deg, #15254a, #1a3058);
    color: var(--blue-300);
  }
  .whatsapp-icon {
    background: linear-gradient(135deg, #0f2a1e, #133525);
    color: #34d399;
  }
  .email-icon {
    background: linear-gradient(135deg, #2a2210, #352a15);
    color: #fbbf24;
  }
  .catalog-icon {
    background: linear-gradient(135deg, #1a1540, #221a50);
    color: #a78bfa;
  }

  /* Catalog */
  .catalog-trigger {
    border-color: var(--dm-border);
  }

  .buttons-section.catalog-active .catalog-trigger {
    border-color: var(--blue-600);
    background: var(--dm-card-secondary);
  }

  .catalog-submenu .catalog-item {
    background: var(--dm-card-secondary);
    border-color: var(--dm-border);
    color: var(--blue-200);
  }

  .catalog-item:hover {
    background: var(--dm-card);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    border-color: var(--dm-border-hover);
  }

  .catalog-brand-logo {
    filter: brightness(0) invert(1);
    opacity: 0.9; /* Slight opacity to soften the harsh white */
  }
  .catalog-item-arrow {
    color: var(--blue-400);
  }

  /* Footer */
  .footer {
    background: var(--dm-card);
  }

  .footer-line {
    background: linear-gradient(90deg, transparent, var(--dm-border), transparent);
  }

  .footer-text {
    color: var(--dm-text-muted);
  }

  /* Scrollbar */
  ::-webkit-scrollbar-thumb {
    background: var(--blue-700);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--blue-600);
  }

  /* Selection */
  ::selection {
    background: var(--blue-700);
    color: var(--white);
  }
}
