/* Main CSS for invoicer.lt */

/* Base styles */
body, html {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  scroll-behavior: smooth;
  text-size-adjust: 100%; /* Prevent text size adjustment */
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Prevent layout shifts from images */
img {
  max-width: 100%;
  height: auto;
  aspect-ratio: attr(width) / attr(height);
  display: block; /* Prevent line-height influence */
}

/* Set explicit dimensions for all images without dimensions */
img:not([width]):not([height]) {
  aspect-ratio: 16/9;
}

/* Header styles with fixed dimensions to prevent shifts */
.site-header {
  background-color: #00C48C;
  color: white;
  padding: 20px;
  text-align: center;
  min-height: 150px; /* Reserve space to prevent layout shifts */
  position: relative; /* Create stacking context */
  z-index: 10; /* Ensure header is above other content */
  contain: layout style paint; /* Improve performance */
}

.site-logo {
  max-width: 150px;
  width: 150px;
  height: 50px;
  object-fit: contain;
  margin: 0 auto; /* Center logo */
}

.site-title {
  margin: 10px 0;
  font-size: 24px;
  line-height: 1.2;
  height: auto;
}

/* Navigation styles with fixed dimensions */
.main-nav {
  margin-top: 15px;
  padding: 10px 0;
  width: 100%;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  min-height: 44px; /* Ensure consistent height */
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  display: inline-flex; /* Ensure consistent rendering */
  align-items: center;
  height: 34px; /* Fixed height to prevent shifts */
  box-sizing: border-box;
}

.nav-link-primary {
  font-weight: bold;
}

.nav-link-bordered {
  border: 1px solid white;
  border-radius: 4px;
}

.nav-link-button {
  background-color: white;
  border-radius: 4px;
  color: #00C48C;
  font-weight: bold;
}

/* Main content styles with fixed dimensions */
.main-content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.section {
  margin-bottom: 40px;
  width: 100%;
  box-sizing: border-box;
  contain: content; /* Improve performance */
}

.section-title {
  color: #333;
  margin-bottom: 20px;
  line-height: 1.2;
  height: auto;
}

.section-text {
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
  height: auto;
}

/* Button styles with fixed dimensions */
.button-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  min-height: 48px; /* Reserve space for buttons */
}

.button {
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px; /* Fixed height to prevent shifts */
  box-sizing: border-box;
  min-width: 120px; /* Minimum width to prevent shifts */
}

.button-primary {
  background-color: #00C48C;
  color: white;
  font-weight: bold;
  margin-right: 15px;
}

.button-secondary {
  background-color: #f5f5f5;
  color: #333;
}

/* Integration partners section with fixed dimensions */
.partners-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 20px;
  min-height: 40px; /* Minimum height to prevent shifts */
}

.partner-link {
  text-decoration: none;
  color: #666;
  padding: 10px 15px;
  border: 1px solid #eee;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px; /* Minimum width to prevent shifts */
  height: 40px; /* Fixed height to prevent shifts */
}

/* Footer styles with fixed dimensions */
.site-footer {
  background-color: #f5f5f5;
  padding: 30px 20px;
  text-align: center;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  contain: layout style paint; /* Improve performance */
}

.footer-columns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 20px;
}

.footer-column-title {
  color: #333;
  margin-bottom: 15px;
  height: auto;
}

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

.footer-list-item {
  margin-bottom: 8px;
  height: 24px; /* Fixed height to prevent shifts */
}

.footer-link {
  color: #666;
  text-decoration: none;
  display: inline-block;
  line-height: 24px; /* Match height of list item */
}

.copyright {
  color: #999;
  font-size: 14px;
  margin: 10px 0;
  height: auto;
}

.social-links {
  margin-top: 15px;
  min-height: 24px; /* Minimum height to prevent shifts */
}

.social-link {
  color: #666;
  text-decoration: none;
  margin: 0 10px;
  display: inline-flex;
  align-items: center;
  height: 24px; /* Fixed height to prevent shifts */
}

/* Font loading optimization */
@font-face {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-display: swap;
}

/* Responsive styles */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .container {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 10px;
  }
  
  .button-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .button-primary {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

/* Prevent content jumps during loading */
html {
  overflow-y: scroll;
}
