:root {
  --primary-color: #4a6ee0;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --dark-color: #212529;
  --light-color: #f8f9fa;
  --tab-bg: #fff;
  --tab-shadow: 0 4px 24px rgba(74,110,224,0.08);
  --tab-active: #4a6ee0;
  --tab-hover: #eaf0ff;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

/* Animated SVG wave divider for hero section */
.svg-divider {
  display: block;
  width: 100%;
  height: 80px;
  margin-bottom: -2rem;
  position: relative;
  z-index: 3;
}

/* Animated gradient background for hero */
.hero-section {
  background: linear-gradient(120deg, #4a6ee0 0%, #6350b5 100%, #4a6ee0 100%);
  background-size: 200% 200%;
  animation: gradientMove 6s ease-in-out infinite alternate;
  padding: 2.5rem 0 2rem 0;
  color: white;
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Card hover pop and shadow */
.feature-card {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s;
  cursor: pointer;
  background: white;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-5px);
  border: 2px solid #4a6ee0;
}

.feature-icon {
  width: 60px;
  height: 60px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

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

.btn-primary:hover {
  background-color: #3a5dbc;
  border-color: #3a5dbc;
}

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

.bd-placeholder-img {
  font-size: 1.125rem;
  text-anchor: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

@media (min-width: 768px) {
  .bd-placeholder-img-lg {
    font-size: 3.5rem;
  }
}

.b-example-divider {
  height: 3rem;
  background-color: rgba(0, 0, 0, .1);
  border: solid rgba(0, 0, 0, .15);
  border-width: 1px 0;
  box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}

@media (min-width: 992px) {
  .rounded-lg-3 { border-radius: .3rem; }
}

#urlresult {
  transition: opacity 0.5s ease-in-out;
}

.tracker-form {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

footer {
  background-color: var(--dark-color);
  color: var(--light-color);
  padding: 2rem 0;
}

.code-block {
  background: #f1f1f1;
  padding: 1rem;
  border-radius: 5px;
  border-left: 4px solid var(--primary-color);
}

/* Translation support */
.language-selector {
  position: relative;
  margin-left: 15px;
}

/* Language badge */
.language-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.language-badge:hover {
  transform: scale(1.1);
}

/* Language dropdown styling */
.language-dropdown .dropdown-item {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}

.language-dropdown .dropdown-item.active {
  background-color: rgba(74, 110, 224, 0.1);
  color: var(--primary-color);
}

/* RTL support for Arabic */
[dir="rtl"] .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

[dir="rtl"] .me-1,
[dir="rtl"] .me-2,
[dir="rtl"] .me-3,
[dir="rtl"] .me-4 {
  margin-right: 0 !important;
  margin-left: 0.25rem !important;
}

[dir="rtl"] .me-2 {
  margin-left: 0.5rem !important;
}

[dir="rtl"] .me-3 {
  margin-left: 1rem !important;
}

[dir="rtl"] .me-4 {
  margin-left: 1.5rem !important;
}

[dir="rtl"] .text-start {
  text-align: right !important;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

/* Language transition effect */
.translating {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.dropdown-item-flag {
  width: 20px;
  height: 15px;
  margin-right: 10px;
  border-radius: 2px;
}

[dir="rtl"] .dropdown-item-flag {
  margin-right: 0;
  margin-left: 10px;
}

/* Active language indicator */
.dropdown-item .check-icon {
  opacity: 0;
  margin-left: auto;
  color: var(--primary-color);
  transition: opacity 0.2s ease;
}

.dropdown-item.active .check-icon {
  opacity: 1;
}

[dir="rtl"] .dropdown-item .check-icon {
  margin-left: 0;
  margin-right: auto;
}

@media (max-width: 992px) {
  .language-selector {
    margin-top: 10px;
  }
}

/* Responsive improvements */
@media (max-width: 576px) {
  .hero-section { padding: 1.2rem 0 0.5rem 0; }
  .tracker-form { padding: 0.7rem 0.2rem; }
  .feature-card { margin-bottom: 1.2rem; }
  .display-4, .display-5 { font-size: 2rem; }
}

/* Onboarding tooltip styles */
.onboard-tooltip {
  position: absolute;
  z-index: 9999;
  background: #fff;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(74,110,224,0.18);
  padding: 1rem 1.2rem;
  font-size: 1rem;
  max-width: 260px;
  border: 2px solid #4a6ee0;
  animation: tooltipPop 0.4s cubic-bezier(.4,0,.2,1);
}

.onboard-tooltip-arrow {
  position: absolute;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #4a6ee0;
  left: 30px;
  top: 100%;
}

@keyframes tooltipPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* Interactive entrance animations */
.fade-in-up { opacity: 0; transform: translateY(40px); transition: all 0.7s cubic-bezier(.4,0,.2,1); }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }
.fade-in-left { opacity: 0; transform: translateX(-40px); transition: all 0.7s cubic-bezier(.4,0,.2,1); }
.fade-in-left.visible { opacity: 1; transform: translateX(0); }
.fade-in-right { opacity: 0; transform: translateX(40px); transition: all 0.7s cubic-bezier(.4,0,.2,1); }
.fade-in-right.visible { opacity: 1; transform: translateX(0); }

/* --- Modern Rounded Tabs Styling (Fit Local Page Color) --- */
.nav-tabs {
  background: var(--light-color);
  border-radius: 2.2rem 2.2rem 0 0;
  box-shadow: 0 6px 24px rgba(74,110,224,0.08);
  padding: 0.5rem 0.5rem 0 0.5rem;
  margin-bottom: 2.5rem;
  border: none;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  flex-wrap: wrap;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 2rem 2rem 0 0;
  color: var(--primary-color);
  background: transparent;
  font-weight: 700;
  font-size: 1.35rem;
  padding: 1.1rem 2.8rem 1.1rem 2.8rem;
  margin: 0 0.2rem 0.5rem 0.2rem;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7em;
  letter-spacing: 0.01em;
  z-index: 1;
  min-width: fit-content;
  text-align: center;
  justify-content: center;
}

.nav-tabs .nav-link .fas {
  font-size: 1.3em;
  margin-right: 0.5em;
  transition: transform 0.3s ease;
}

.nav-tabs .nav-link.active, .nav-tabs .nav-link:focus {
  background: linear-gradient(135deg, #4a6ee0 0%, #6350b5 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(74,110,224,0.15);
  z-index: 2;
  transform: translateY(-6px) scale(1.05);
}

.nav-tabs .nav-link.active .fas, .nav-tabs .nav-link:focus .fas {
  transform: scale(1.2);
}

.nav-tabs .nav-link.active::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 5px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #4a6ee0 0%, #6350b5 100%);
  box-shadow: 0 2px 8px rgba(74,110,224,0.15);
}

.nav-tabs .nav-link:hover:not(.active) {
  background: var(--tab-hover);
  color: var(--primary-color);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 4px 16px rgba(74,110,224,0.08);
}

.nav-tabs::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(74,110,224,0.2) 50%, transparent 100%);
}

.tab-content {
  position: relative;
  z-index: 1;
}

.tab-pane {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-pane.fade {
  opacity: 0;
  transform: translateY(10px);
}

.tab-pane.fade.show {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile-friendly tab navigation */
.nav-tabs-mobile {
  border-bottom: 2px solid #dee2e6;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs-mobile .nav-item {
  white-space: nowrap;
  min-width: 0;
}

.mobile-tab {
  padding: 0.75rem 0.5rem !important;
  font-size: 0.9rem;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  background: none !important;
  transition: all 0.3s ease;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mobile-tab:hover {
  border-bottom-color: var(--primary-color) !important;
  background-color: rgba(0, 123, 255, 0.1) !important;
}

.mobile-tab.active {
  color: var(--primary-color) !important;
  background-color: rgba(0, 123, 255, 0.1) !important;
  border-bottom-color: var(--primary-color) !important;
  font-weight: 600;
}

.mobile-tab i {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.small-text {
  font-size: 0.75rem;
  line-height: 1.2;
}

/* Mobile specific adjustments */
@media (max-width: 576px) {
  .nav-tabs-mobile {
    margin: 0 -15px;
    padding: 0 15px;
  }
  
  .mobile-tab {
    padding: 0.5rem 0.25rem !important;
    font-size: 0.8rem;
    min-height: 55px;
  }
  
  .mobile-tab i {
    font-size: 1rem;
    margin-bottom: 0.2rem;
  }
  
  .small-text {
    font-size: 0.7rem;
    font-weight: 500;
  }
  
  /* Ensure tabs stay in one line */
  .nav-tabs-mobile .nav-item {
    flex: 1 1 33.333%;
    max-width: 33.333%;
  }
  
  /* Hide overflow for very small screens */
  .container.mt-5 {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 480px) {
  .mobile-tab {
    padding: 0.4rem 0.2rem !important;
    font-size: 0.75rem;
    min-height: 50px;
  }
  
  .mobile-tab i {
    font-size: 0.9rem;
  }
  
  .small-text {
    font-size: 0.65rem;
  }
}

/* Very small screens - compact mode */
@media (max-width: 375px) {
  .small-text {
    font-size: 0.6rem;
    line-height: 1.1;
  }
  
  .mobile-tab {
    padding: 0.3rem 0.1rem !important;
    min-height: 45px;
  }
  
  .mobile-tab i {
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
  }
}

/* Improve tab content spacing on mobile */
@media (max-width: 768px) {
  .tab-content {
    padding-top: 1.5rem !important;
  }
  
  .hero-section {
    padding: 1rem 0;
  }
  
  .tracker-form {
    padding: 0 10px;
  }
}

/* Enhanced mobile-friendly input and form styling */
.input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

@media (max-width: 576px) {
  .hero-section { 
    padding: 1.5rem 0 1rem 0; 
    margin: 0 -15px;
  }
  .tracker-form { 
    padding: 1rem; 
    margin: 0 1rem 1rem 1rem;
  }
  .input-group {
    flex-direction: column;
    gap: 0.75rem;
  }
  .input-group .form-control {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
  }
  .input-group .btn {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
  }
  .feature-card { 
    margin-bottom: 1rem; 
    padding: 1rem;
  }
  .display-4, .display-5 { 
    font-size: 1.75rem; 
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  .lead {
    font-size: 1.1rem;
  }
  
  /* IP checker mobile improvements */
  #ip-check .input-group {
    margin-bottom: 1.5rem;
  }
  #findanip {
    font-size: 16px;
    padding: 0.75rem 1rem;
  }
  #findanipbutton {
    padding: 0.875rem 1rem;
    font-weight: 600;
  }
  
  /* Email tracker mobile improvements */
  #email .content-section {
    padding: 1rem;
    margin: 0 1rem 1rem 1rem;
  }
  #myRange2 {
    width: 100% !important;
    margin: 1rem 0;
  }
  
  /* Results section mobile */
  #urlresult .row {
    margin: 0;
  }
  #urlresult .col-md-6 {
    padding: 0.5rem;
    margin-bottom: 1rem;
  }
  #urlresult .h-100 {
    padding: 1rem !important;
  }
  
  /* Navigation mobile improvements */
  .navbar-nav {
    text-align: center;
    padding-top: 1rem;
  }
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
  }
  .language-selector {
    margin: 1rem 0 0 0;
    justify-content: center;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  .input-group .form-control,
  .input-group .btn {
    width: 100%;
    font-size: 16px;
  }
  .tracker-form {
    padding: 1.25rem;
  }
  .hero-section {
    padding: 2rem 0 1.5rem 0;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .input-group .form-control {
    font-size: 15px;
  }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
  .btn {
    min-height: 44px; /* Apple's recommended minimum touch target */
    padding: 0.75rem 1.5rem;
  }
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .form-control {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on mobile */
  }
}

/* Improved container spacing for mobile */
@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
  .col-lg-8.mx-auto,
  .col-lg-6.mx-auto {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Enhanced slider styling for email tracker */
.slider-verification {
  height: 8px;
  border-radius: 50px;
  outline: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider-verification::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc3545;
  cursor: grab;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  transition: all 0.3s ease;
}

.slider-verification::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.slider-verification::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

.slider-verification::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc3545;
  cursor: grab;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  transition: all 0.3s ease;
}

.slider-verification::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.slider-verification::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

.slider-container {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.slider-container.completed {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.2);
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

.slider-instructions {
  font-size: 0.9rem;
  animation: pulse 2s infinite;
}

.slider-instructions.completed {
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

#emailGenerateBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#emailGenerateBtn:enabled {
  animation: buttonGlow 2s infinite;
}

@keyframes buttonGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(220, 53, 69, 0.5); }
  50% { box-shadow: 0 0 20px rgba(220, 53, 69, 0.8); }
}

/* Slider guide animations */
.slider-guide {
  pointer-events: none;
  animation: slideGuideIn 0.8s ease-out;
}

.slider-guide.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s ease;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.arrow-bounce {
  animation: bounce 1.5s infinite;
}

@keyframes slideGuideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-8px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Hide the guide when slider is being used */
.slider-container:hover .slider-guide,
.slider-container.completed .slider-guide {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

/* Enhanced slider thumb interaction feedback */
.slider-verification:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Add a subtle glow effect to draw attention */
.slider-verification {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s ease;
}

.slider-verification:hover {
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}

/* Mobile improvements for the guide */
@media (max-width: 576px) {
  .slider-guide {
    top: -40px;
  }
  .slider-guide .text-white {
    font-size: 0.8rem;
  }
}
