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

:root {
  --primary: #4A9EFF;
  --secondary: #00D4FF;
  --dark: #0a0e27;
  --light: #1a1f3a;
  --accent: #00D4FF;
  --text: #e0e0e0;
  --gray: #a0a0a0;
}

html {
  scroll-behavior: smooth;
  /* Prevent horizontal scroll on all browsers */
  overflow-x: hidden;
  /* Ensure proper width */
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: #0a0e27;
  background-image: radial-gradient(circle at top center, rgba(15, 25, 60, 0.3), transparent),
    radial-gradient(circle at 20% 80%, rgba(10, 15, 45, 0.25), transparent),
    radial-gradient(circle at 80% 20%, rgba(20, 30, 70, 0.2), transparent);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

canvas {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
}


main {
  position: relative;
  min-height: 100vh;
}

header {
  background: #1a1f3a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.logo {
  height: 50px;
  max-width: 100%;
  object-fit: contain;
}

.company-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.company-name .line1 {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.company-name .line2 {
  font-weight: 600;
  font-size: 0.95rem;
  color: #b0b0b0;
}

.nav-links, .nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a, .nav-menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover, .nav-menu a:hover {
  color: var(--primary);
}

.auth-btns {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  font-size: 0.95rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: #0a0e27 !important;
}

.btn-primary:hover {
  background: #0a0e27;
  color: #0a0e27 !important;
  border: 2px solid var(--primary);
}

.btn-primary:active,
.btn-primary:focus {
  background: #0a0e27;
  color: #0a0e27 !important;
  border: 2px solid var(--primary);
}

/* Specific overrides for auth buttons to ensure text color stays dark */
.auth-btns .btn-primary,
.auth-btns a.btn-primary,
a.btn.btn-primary {
  color: #0a0e27 !important;
}

.auth-btns .btn-primary:hover,
.auth-btns a.btn-primary:hover,
a.btn.btn-primary:hover {
  color: #0a0e27 !important;
  background: #0a0e27;
  border: 2px solid var(--primary);
}

.auth-btns .btn-primary:active,
.auth-btns .btn-primary:focus,
.auth-btns a.btn-primary:active,
.auth-btns a.btn-primary:focus,
a.btn.btn-primary:active,
a.btn.btn-primary:focus {
  color: #0a0e27 !important;
  background: #0a0e27;
  border: 2px solid var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #0a0e27;
}

.hero {
  background: linear-gradient(135deg, rgba(20, 30, 70, 0.8), rgba(10, 20, 50, 0.7)), url('../images/hero_bg.png') center/cover no-repeat;
  color: white;
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: white;
}

.hero p {
  font-size: 1.3rem;
  opacity: 0.9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
}

/* Floating shapes removed - network nodes only */

.section {
  margin-bottom: 4rem;
  position: relative;
  z-index: 1;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.products-section {
  background: transparent;
  padding: 2rem 0;
}

.expertise-section {
  background: transparent;
  padding: 2rem 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: rgba(26, 31, 58, 0.8);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
  border-color: rgba(74, 158, 255, 0.4);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card ul li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
  color: var(--text);
}

.card ul li:before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  font-size: 1.2rem;
  position: absolute;
  left: 0;
  top: 0.4rem;
}

@media (max-width: 768px) {
  .card ul li {
    padding: 0.4rem 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
  }

  .card ul li:before {
    font-size: 1rem;
    top: 0.3rem;
  }
}

@media (max-width: 480px) {
  .card ul li {
    padding: 0.35rem 0;
    padding-left: 1rem;
    font-size: 0.85rem;
  }

  .card ul li:before {
    font-size: 0.9rem;
    top: 0.25rem;
  }
}

footer {
  background: #0d1128;
  color: white;
  padding: 2rem;
  border-top: 2px solid rgba(74, 158, 255, 0.4);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-info {
  text-align: center;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1a1f3a;
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background-color: rgba(10, 14, 39, 0.5);
  color: var(--text);
}

.form-group select {
  background-color: rgba(10, 14, 39, 0.5);
  cursor: pointer;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.social-auth {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.social-btn {
  padding: 0.8rem;
  border: 1px solid rgba(74, 158, 255, 0.3);
  background: rgba(26, 31, 58, 0.6);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.social-btn:hover {
  background: rgba(26, 31, 58, 0.9);
  border-color: rgba(74, 158, 255, 0.5);
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: rgba(74, 158, 255, 0.3);
}

.divider span {
  background: #1a1f3a;
  padding: 0 1rem;
  position: relative;
  color: var(--gray);
}

.blog-post {
  background: rgba(26, 31, 58, 0.8);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.3s;
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.blog-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
  border-color: rgba(74, 158, 255, 0.4);
}

.blog-link {
  text-decoration: none;
  color: inherit;
}

.blog-post h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.blog-link:hover h3 {
  color: var(--secondary);
}

.blog-post .meta {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.read-more {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.5rem;
}

.read-more:hover {
  text-decoration: underline;
}

.hamburger, .mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span, .mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1), .mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2), .mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3), .mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== Profile Dropdown Styles ===== */
.profile-dropdown {
    position: relative;
    display: none;
}

.profile-dropdown.active {
    display: block;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    background: transparent;
    border: none;
}

.profile-trigger:hover {
    background-color: rgba(74, 158, 255, 0.1);
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.profile-name {
    font-weight: var(--font-weight-medium);
    font-size: 0.95rem;
    color: var(--color-gray-900);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    width: 18px;
    height: 18px;
    color: var(--color-gray-500);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.profile-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: #1a1f3a;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    padding: 0.5rem;
    display: none;
    z-index: 1000;
    animation: slideDown 0.2s ease;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-gray-700);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: rgba(74, 158, 255, 0.1);
    color: var(--color-primary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--color-gray-200);
    margin: 0.5rem 0;
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
    .profile-trigger {
        padding: 0.375rem 0.625rem;
        gap: 0.5rem;
    }

    .profile-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.875rem;
    }

    .profile-name {
        font-size: 0.9rem;
        max-width: 100px;
    }

    .dropdown-arrow {
        width: 16px;
        height: 16px;
    }

    .dropdown-menu {
        min-width: 180px;
    }

    .dropdown-item {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .profile-trigger {
        padding: 0.25rem 0.5rem;
        gap: 0.375rem;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .profile-name {
        font-size: 0.85rem;
        max-width: 70px;
    }

    .dropdown-menu {
        min-width: 160px;
        right: -0.5rem;
    }

    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Blog Article Styles */
.blog-article {
  background: rgba(26, 31, 58, 0.8);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 900px;
  margin: 2rem auto;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.article-header {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(10, 14, 39, 1);
  border-radius: 8px;
  margin: -2rem -2rem 2rem -2rem;
  border-bottom: 2px solid rgba(74, 158, 255, 0.3);
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1rem;
  display: inline-block;
}

.back-link:hover {
  text-decoration: underline;
}

.article-header h1 {
  color: var(--text);
  margin: 1rem 0;
  font-size: 2.2rem;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.article-actions {
  margin-top: 1rem;
}

.like-btn {
  background: rgba(26, 31, 58, 0.6);
  border: 2px solid rgba(74, 158, 255, 0.4);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.like-btn:hover {
  background: rgba(26, 31, 58, 0.9);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(74, 158, 255, 0.3);
}

.like-btn.liked {
  background: var(--primary);
  color: #0a0e27;
}

.like-btn .icon {
  font-size: 1.2rem;
}

.article-content h2 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

.article-content h3 {
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.article-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1rem 2rem;
  line-height: 1.8;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.references {
  background: rgba(10, 14, 39, 0.6);
  padding: 1.5rem;
  border-radius: 6px;
  margin-top: 2rem;
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.references h2 {
  margin-top: 0;
}

.references ol {
  margin-left: 1.5rem;
}

.references li {
  margin-bottom: 1rem;
}

.references a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.references a:hover {
  text-decoration: underline;
}

.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(74, 158, 255, 0.3);
}

.comments-section h3 {
  color: var(--text);
  margin-bottom: 1.5rem;
}

.comment-form {
  margin-bottom: 2rem;
}

.comment-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
  resize: vertical;
  background: rgba(10, 14, 39, 0.5);
  color: var(--text);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment {
  background: rgba(26, 31, 58, 0.6);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-header strong {
  color: var(--text);
}

.comment-time {
  color: var(--gray);
  font-size: 0.85rem;
}

.comment-body {
  color: var(--text);
  line-height: 1.6;
}

/* ===== Tablet and Mobile Responsive ===== */
@media (max-width: 1024px) {
  nav {
    padding: 0.8rem 1rem;
    position: relative;
  }

  .hamburger, .mobile-menu-toggle {
    display: flex;
    order: 3;
  }

  .nav-links, .nav-menu {
    position: fixed;
    top: var(--header-height, 70px);
    left: 0;
    width: 100%;
    background: #1a1f3a;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    display: none;
    z-index: 999;
  }

  .nav-links.active, .nav-menu.active {
    display: flex;
    max-height: calc(100vh - var(--header-height, 70px));
    overflow-y: auto;
  }

  .nav-links li, .nav-menu li {
    width: 100%;
    border-bottom: 1px solid var(--color-gray-200);
  }

  .nav-links a, .nav-menu a {
    display: block;
    padding: 1rem 1.5rem;
    width: 100%;
  }

  .auth-btns {
    order: 2;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .blog-article {
    padding: 1.5rem;
    margin: 1rem auto;
  }

  .article-header {
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 1rem;
  }

  .article-header h1 {
    font-size: 1.6rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .article-content h2 {
    font-size: 1.4rem;
  }

  .article-content h3 {
    font-size: 1.2rem;
  }

  .references {
    padding: 1rem;
  }

  .comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .logo {
    height: 40px;
  }

  .company-name .line1 {
    font-size: 0.9rem;
  }

  .company-name .line2 {
    font-size: 0.8rem;
  }

  .hero {
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .container {
    padding: 2rem 1rem;
  }

  .section h2 {
    font-size: 1.6rem;
  }

  .products-section,
  .expertise-section {
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 2rem 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  footer {
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
  }

  .footer-links {
    gap: 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .section h2 {
    font-size: 1.4rem;
  }

  .auth-btns {
    gap: 0.5rem;
  }

  .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .container {
    padding: 2.5rem 1.5rem;
  }
}

/* ===== Modal Styles ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Mobile: Prevent scroll behind modal and enable smooth scrolling */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-content {
  background: rgba(26, 31, 58, 0.95);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 2rem;
  border-bottom: 2px solid rgba(74, 158, 255, 0.3);
  background: rgba(26, 31, 58, 1);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
  position: relative;
}

.modal-header h2 {
  color: var(--color-primary);
  font-size: 1.8rem;
  margin: 0;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--color-gray-500);
  transition: color 0.2s ease, transform 0.2s ease;
  line-height: 1;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--color-primary);
  background: rgba(74, 158, 255, 0.1);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  /* Safari iOS: Enable momentum scrolling */
  -webkit-overflow-scrolling: touch;
  /* Prevent horizontal scroll */
  overflow-x: hidden;
}

.modal-body h3 {
  color: var(--color-gray-900);
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.modal-body p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--color-gray-700);
}

.modal-body ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: var(--color-gray-700);
}

@media (max-width: 768px) {
  .modal-content {
    max-height: 90vh;
    margin: 0.5rem;
  }

  .modal-header {
    padding: 1.5rem;
  }

  .modal-header h2 {
    font-size: 1.5rem;
    padding-right: 2rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
  }
}

/* ===== Mobile Browser Specific Fixes ===== */
/* Safari iOS: Fix 100vh issues with address bar */
@supports (-webkit-touch-callout: none) {
  .min-h-screen {
    min-height: -webkit-fill-available;
  }

  .h-screen {
    height: -webkit-fill-available;
  }
}

/* All Mobile Browsers: Ensure proper box-sizing */
* {
  box-sizing: border-box;
  /* Prevent text size adjust on orientation change */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Mobile: Improve link and button tap targets */
a, button, input[type="submit"], input[type="button"], input[type="reset"] {
  /* Remove tap delay on mobile */
  touch-action: manipulation;
}

/* Mobile: Prevent rubber band scrolling on body */
@media (max-width: 768px) {
  body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: auto;
  }

  main {
    min-height: 100vh;
  }
}

/* Safari iOS: Fix input zoom issues */
@media screen and (max-width: 768px) {
  select, textarea, input[type="text"], input[type="password"],
  input[type="datetime"], input[type="datetime-local"],
  input[type="date"], input[type="month"], input[type="time"],
  input[type="week"], input[type="number"], input[type="email"],
  input[type="url"], input[type="search"], input[type="tel"] {
    font-size: 16px !important;
  }
}

/* Mobile: Improve dropdown menu positioning */
@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    top: auto;
    right: 1rem;
    left: 1rem;
    max-width: calc(100vw - 2rem);
    /* Enable momentum scrolling */
    -webkit-overflow-scrolling: touch;
  }
}

/* Edge Mobile: Fix flexbox issues */
@supports (-ms-ime-align: auto) {
  .flex, .flex-col, .flex-row {
    display: -ms-flexbox;
    display: flex;
  }
}

/* Mozilla Mobile: Optimize rendering */
@-moz-document url-prefix() {
  @media (max-width: 768px) {
    * {
      -moz-osx-font-smoothing: grayscale;
    }
  }
}
