/* IntlMail.com - Optimized Production CSS */
/* Critical CSS for Above-the-Fold Content */
:root {
  --primary: #0052cc;
  --primary-dark: #003d99;
  --primary-light: #4d94ff;
  --secondary: #00875a;
  --danger: #de350b;
  --warning: #ffab00;
  --bg-light: #f4f5f7;
  --bg-white: #ffffff;
  --text-primary: #172b4d;
  --text-secondary: #5e6c84;
  --border: #dfe1e6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 4px;
  --radius-lg: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition: all 0.2s ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--bg-white);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-sm {
  max-width: 768px;
}

.container-lg {
  max-width: 1400px;
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1.5rem;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.mobile-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

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

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.btn-white {
  background: white;
  color: var(--primary);
  border-color: white;
}

.btn-white:hover {
  background: var(--bg-light);
  color: var(--primary-dark);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card-body {
  padding: 0;
}

.card-footer {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,82,204,0.1);
}

.form-control:disabled {
  background: var(--bg-light);
  cursor: not-allowed;
  opacity: 0.6;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  background: var(--bg-light);
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--bg-light);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.badge-success {
  background: var(--secondary);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: var(--text-primary);
}

.badge-danger {
  background: var(--danger);
  color: white;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-info {
  background: #e3f2ff;
  border-color: #b3d9ff;
  color: #004085;
}

.alert-success {
  background: #d4f4dd;
  border-color: #b7e4c7;
  color: #155724;
}

.alert-warning {
  background: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.alert-danger {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Calculator Specific */
.calculator {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.calculator-header {
  text-align: center;
  margin-bottom: 2rem;
}

.calculator-form {
  display: grid;
  gap: 1.5rem;
}

.calculator-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calculator-results {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.result-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.result-carrier {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.carrier-logo {
  width: 60px;
  height: 40px;
  object-fit: contain;
}

.result-details {
  flex: 1;
}

.result-service {
  font-weight: 600;
  color: var(--text-primary);
}

.result-delivery {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.result-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Comparison Tables */
.comparison-table {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.comparison-header {
  background: var(--primary);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.comparison-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.comparison-row:last-child {
  border-bottom: none;
}

.comparison-label {
  padding: 1rem;
  font-weight: 600;
  background: var(--bg-light);
  border-right: 1px solid var(--border);
}

.comparison-value {
  padding: 1rem;
  text-align: center;
}

.comparison-value.winner {
  background: #d4f4dd;
  font-weight: 600;
  color: var(--secondary);
}

/* Country Pages */
.country-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.country-flag {
  width: 60px;
  height: 40px;
  display: inline-block;
  margin-right: 1rem;
  vertical-align: middle;
}

.shipping-options {
  display: grid;
  gap: 1rem;
}

.shipping-option {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.shipping-option:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-section a {
  color: rgba(255,255,255,0.8);
  display: block;
  margin-bottom: 0.5rem;
}

.footer-section a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: rgba(255,255,255,0.6);
}

/* Loading States */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,82,204,0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
  0% { background-color: var(--bg-light); }
  100% { background-color: #e0e0e0; }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--secondary); }
.text-warning { color: var(--warning); }

.bg-light { background: var(--bg-light); }
.bg-white { background: var(--bg-white); }
.bg-primary { background: var(--primary); color: white; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 3rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

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

  .nav {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background: white;
    flex-direction: column;
    padding: 2rem;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .nav.active {
    left: 0;
  }

  .mobile-menu {
    display: block;
  }

  .calculator-row {
    grid-template-columns: 1fr;
  }

  .comparison-row {
    grid-template-columns: 1fr;
  }

  .comparison-label {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .shipping-option {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .hero {
    padding: 2rem 0;
  }

  .card {
    padding: 1rem;
  }

  .btn {
    width: 100%;
    display: block;
  }
}

/* Print Styles */
@media print {
  .header, .footer, .nav, .mobile-menu, .btn, .calculator-form {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  .table {
    page-break-inside: avoid;
  }
}

/* Performance Optimizations */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary: #0040a0;
    --text-primary: #000000;
    --text-secondary: #333333;
    --border: #000000;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-white: #1a1a1a;
    --bg-light: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border: #404040;
  }

  .card, .form-control {
    background: var(--bg-light);
    color: var(--text-primary);
  }
}