/* ==========================================================================
   Dark Glassmorphism Theme - Jahan Ertebat Ideal Co.
   ========================================================================== */

:root {
  --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --bg-dark: #090d16;
  --bg-card: rgba(18, 26, 43, 0.65);
  --bg-card-hover: rgba(28, 40, 65, 0.75);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(245, 158, 11, 0.3);
  
  --primary-gold: #fbbf24;
  --primary-amber: #f59e0b;
  --primary-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --whatsapp-green: #25d366;
  --telegram-blue: #0088cc;
  --instagram-pink: #e1306c;
  --bale-cyan: #00a896;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  
  --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.15);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(30, 58, 138, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    url('assets/bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 12px;
  overflow-x: hidden;
  direction: rtl;
  line-height: 1.6;
}

/* Ambient Glow Background Spheres */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 320px;
  height: 320px;
  background: rgba(245, 158, 11, 0.12);
  top: -50px;
  right: -50px;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: rgba(56, 189, 248, 0.12);
  bottom: 10%;
  left: -100px;
}

.glow-3 {
  width: 250px;
  height: 250px;
  background: rgba(59, 130, 246, 0.15);
  top: 40%;
  right: 15%;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
}

/* Glass Card Component */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: 0.8s;
  pointer-events: none;
}

.glass-card:hover::before {
  left: 100%;
}

/* Hero Card */
.hero-card {
  text-align: center;
  padding-top: 32px;
  border-top: 2px solid var(--primary-amber);
}

.card-top-decoration {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
  border-radius: 0 0 4px 4px;
}

.logo-wrapper {
  display: inline-block;
  position: relative;
  margin-bottom: 16px;
}

.logo-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(56, 189, 248, 0.2));
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-card:hover .logo-circle {
  transform: scale(1.06) rotate(3deg);
}

.logo-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.company-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.company-english {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--primary-gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--primary-gold);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.company-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 22px;
  padding: 0 10px;
  font-weight: 400;
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(245, 158, 11, 0.45);
}

.qr-btn {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.qr-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.1rem;
}

/* Section Title */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.title-icon {
  color: var(--primary-gold);
  font-size: 1rem;
}

/* Links Grid */
.links-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  width: 100%;
  text-align: right;
}

.link-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-4px);
}

.link-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  transition: all 0.25s ease;
}

.phone-link .link-icon-box { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.whatsapp-link .link-icon-box { background: rgba(37, 211, 102, 0.15); color: var(--whatsapp-green); }
.telegram-link .link-icon-box { background: rgba(0, 136, 204, 0.15); color: #38bdf8; }
.instagram-link .link-icon-box { background: rgba(225, 48, 108, 0.15); color: #f472b6; }
.bale-link .link-icon-box { background: rgba(0, 168, 150, 0.15); color: #2dd4bf; }
.website-link .link-icon-box { background: rgba(245, 158, 11, 0.15); color: var(--primary-gold); }

.link-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.link-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.link-val {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: right;
}

.arrow-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.link-item:hover .arrow-icon {
  color: var(--text-main);
  transform: translateX(-3px);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.service-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  transition: all 0.3s ease;
}

.service-box:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-glow);
  transform: translateY(-3px);
}

.service-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.service-box h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.service-box p {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Section Header Flex */
.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.count-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--primary-cyan);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 14px;
}

.search-box input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.82rem;
  outline: none;
  transition: all 0.25s ease;
}

.search-box input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Projects List */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-left: 4px;
}

/* Scrollbar styling */
.projects-list::-webkit-scrollbar {
  width: 5px;
}
.projects-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}
.projects-list::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 10px;
}
.projects-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold);
}

.project-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-sub);
  transition: all 0.2s ease;
}

.project-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--text-main);
}

.project-num {
  font-weight: 800;
  color: var(--primary-gold);
  min-width: 22px;
  font-size: 0.78rem;
}

/* Location Box */
.location-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.address-details {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.address-text {
  font-size: 0.86rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.gold-text {
  color: var(--primary-gold);
}

.postal-phone {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.location-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.loc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

.map-btn {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.map-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  background: #111827;
  border: 1px solid rgba(245, 158, 11, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  font-size: 1rem;
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: #fff;
}

.phone-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.25s ease;
}

.phone-opt:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary-gold);
  transform: translateX(-3px);
}

.opt-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.opt-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.opt-text .num {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.opt-text .desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.opt-call-icon {
  color: var(--primary-gold);
}

/* QR Modal Specifics */
.text-center {
  text-align: center;
}

.qr-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.qr-container {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#qrcode img, #qrcode canvas {
  margin: 0 auto;
  display: block;
}

.qr-url-display {
  font-size: 0.75rem;
  direction: ltr;
  color: var(--primary-cyan);
  margin-bottom: 16px;
  word-break: break-all;
}

.download-qr-btn {
  width: 100%;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  box-shadow: 0 6px 15px rgba(56, 189, 248, 0.3);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--primary-gold);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  padding: 12px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--primary-gold);
  font-size: 1.1rem;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.developer-credits {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.dev-title {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dev-company {
  font-size: 0.88rem;
  color: var(--primary-gold);
}

.dev-link a {
  color: var(--primary-cyan);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  direction: ltr;
  display: inline-block;
}

.dev-link a:hover {
  text-decoration: underline;
}

.dev-tags {
  font-size: 0.74rem;
  color: var(--text-sub);
}

.dev-agent {
  font-size: 0.76rem;
  color: var(--primary-gold);
  margin-top: 2px;
}

/* Responsiveness */
@media (max-width: 480px) {
  body {
    padding: 12px 8px;
  }
  
  .glass-card {
    padding: 20px 14px;
  }
  
  .company-name {
    font-size: 1.28rem;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
}
