/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #0052cc;
  --color-white: #ffffff;
  --color-light-gray: #f7f8fa;
  --color-accent: #ffc107;
  --color-text: #2c3e50;
  --color-text-light: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #10b981;
  --color-error: #ef4444;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-system);
  color: var(--color-text);
  line-height: 1.6;
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 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-width: 0;
}

/* Skip to main content */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Navigation */
.navbar {
  background-color: var(--color-white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
}

.logo {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo-text {
  position: relative;
  display: inline-block;
}

.logo-text::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 20px;
  height: 3px;
  background-color: var(--color-accent);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--color-primary);
  margin: 3px 0;
  transition: var(--transition);
}

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

.nav-menu a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 0;
  position: relative;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

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

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

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

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

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

.btn-primary:hover {
  background-color: #ffb300;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

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

/* Sections */
.widgets-section,
.features-section,
.content-section {
  padding: 4rem 0;
}

.page-header {
  background-color: var(--color-light-gray);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.page-header p {
  font-size: 1.125rem;
  color: var(--color-text-light);
}

section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--color-primary);
}

/* Grids */
.widgets-grid,
.features-grid,
.education-grid,
.tools-grid,
.products-grid,
.news-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.widgets-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.features-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.education-grid,
.news-grid {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.products-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Cards */
.widget-card,
.feature-card,
.education-card,
.tool-card,
.product-card,
.news-card {
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.widget-card:hover,
.feature-card:hover,
.education-card:hover,
.tool-card:hover,
.product-card:hover,
.news-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

.widget-card h3,
.feature-card h3,
.education-card h2,
.tool-card h2,
.product-card h3,
.news-card h2 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.education-card ul,
.about-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.education-card li,
.about-list li {
  margin-bottom: 0.5rem;
}

/* News Cards */
.news-card {
  overflow: hidden;
  padding: 0; /* removed padding from card container to prevent image sizing issues */
}

/* Enhanced styling for news card images to handle any dimension */
.news-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px 8px 0 0;
  margin: 0;
  transition: var(--transition);
  display: block;
}

.news-card:hover .news-image {
  transform: scale(1.05);
}

/* Enhanced styling for news card images to handle any dimension */
.news-card > :not(.news-image) {
  padding-left: 2rem;
  padding-right: 2rem;
}

.news-card > :first-of-type:not(.news-image) {
  padding-top: 1rem;
}

.news-card > :last-child {
  padding-bottom: 2rem;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.news-category {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
}

.news-meta time {
  color: var(--color-text-light);
}

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

.read-more:hover {
  transform: translateX(5px);
}

/* Product Cards */
.product-card .product-level {
  display: inline-block;
  background-color: var(--color-light-gray);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.product-card .product-topics {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-top: 1rem;
}

/* Rates Display */
.rates-display {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rate-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: var(--color-light-gray);
  border-radius: 6px;
}

.rate-label {
  font-weight: 600;
  color: var(--color-text);
}

.rate-value {
  font-weight: 700;
  color: var(--color-primary);
}

/* Forms */
.calc-form,
.calculator-form,
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

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

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--color-error);
}

.form-group small {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

.error-message {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.show {
  display: block;
}

.required {
  color: var(--color-error);
}

/* Calculator Results */
.calc-result,
.result-box {
  background-color: var(--color-light-gray);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.result-box {
  display: none;
}

.result-box.show {
  display: block;
}

.result-box h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.result-box p {
  margin: 0.5rem 0;
}

.result-note {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-top: 1rem;
  font-style: italic;
}

.conversion-result {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin: 1rem 0;
}

.exchange-rate-info {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.875rem;
}

/* Contact Page */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-top: 2rem;
}

.contact-info h2,
.contact-info h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.contact-details,
.contact-hours {
  margin-top: 2rem;
}

.contact-form-wrapper {
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-success {
  background-color: var(--color-success);
  color: var(--color-white);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  display: none;
}

.form-success.show {
  display: block;
}

/* About Page */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  text-align: left;
  margin-bottom: 1rem;
}

.disclaimer-section {
  margin-top: 3rem;
}

.disclaimer-box {
  background-color: #fff3cd;
  border-left: 4px solid var(--color-accent);
  padding: 1.5rem;
  border-radius: 6px;
}

.disclaimer-box p {
  margin-bottom: 1rem;
}

.disclaimer-box p:last-child {
  margin-bottom: 0;
}

/* CTA Section */
.cta-section {
  background-color: var(--color-light-gray);
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.25rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

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

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

.footer-column h4 {
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: var(--color-white);
  text-decoration: none;
  transition: var(--transition);
  opacity: 0.8;
}

.footer-column a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  opacity: 0.7;
  font-size: 0.875rem;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  z-index: 2000;
  opacity: 0;
  transition: bottom 0.4s ease, opacity 0.4s ease;
}

.cookie-banner.show {
  bottom: 0;
  opacity: 1;
}

.cookie-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-content p {
  flex: 1;
  margin: 0;
  min-width: 300px;
}

.cookie-actions {
  display: flex;
  gap: 1rem;
}

.cookie-actions .btn {
  padding: 0.5rem 1.25rem;
}

.cookie-actions .btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.cookie-actions .btn-secondary:hover {
  background-color: var(--color-light-gray);
  color: var(--color-text);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.fade-in {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

.fade-in:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-in:nth-child(2) {
  animation-delay: 0.2s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.3s;
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--color-white);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    left: 0;
  }

  .hero-title {
    font-size: 2rem;
  }

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

  .widgets-grid,
  .features-grid,
  .education-grid,
  .tools-grid,
  .products-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-actions .btn {
    width: 100%;
  }
}

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

  .hero-title {
    font-size: 1.75rem;
  }

  section h2 {
    font-size: 1.5rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}
