/* Reset ir pagrindiniai nustatymai */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Viršutinė juosta */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.language-selector select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

.language-selector select:hover {
  border-color: #0066cc;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

/* Facebook mygtuko stilius */
.facebook-button {
  background-color: #1877f2;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.facebook-button:hover {
  background-color: #166fe5;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.facebook-button svg {
  flex-shrink: 0;
}

.auth-buttons button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.3s;
}

#login-google {
  background: white;
  color: #4285F4;
  border: 1px solid #ddd;
}

#login-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#login-facebook {
  background: #1877F2;
  color: white;
}

#login-facebook:hover {
  background: #166FE5;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Headeris */
header {
  background: #0066cc;
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Paieškos sekcija */
.search-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 2rem auto;
  max-width: 900px;
  padding: 0 1rem;
}

.search-section input, 
.search-section select {
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 180px;
  font-size: 1rem;
}

.search-section input:focus,
.search-section select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.2);
}

/* Datos pasirinkimo lauko stilius */
.search-section input[type="date"] {
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 180px;
  font-size: 1rem;
  font-family: 'Arial', sans-serif;
}

.search-section input[type="date"]:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.2);
}

#search-btn {
  background: #0066cc;
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

#search-btn:hover {
  background: #0052a3;
}

/* Reklamos - LAIKINAI IŠJUNGTOS */
.ads {
  display: none; /* Laikinai išjungtos reklamos */
}

/* ATNAUJINTI: Rezultatų kortelės - KOMPAKTIŠKOS BE PAVEIKSLĖLIŲ */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
  width: 95%;
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
  margin-left: 140px;
  margin-right: 140px;
}

/* ATNAUJINTA: Kortelės be paveikslėlio - sumažintas dydis */
.card {
  width: 100%;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 120px;
  border: 1px solid #e0e0e0;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-color: #0066cc;
}

.card-content {
  padding: 0.6rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card h3 {
  color: #0066cc;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

/* ATNAUJINTA: Papildomi kortelės elementai */
.card .company {
  color: #666;
  font-size: 0.8rem;
  font-weight: 500;
}

.card .departure-date,
.card .valid-until {
  color: #666;
  font-size: 0.75rem;
}

.card .price {
  color: #2ecc71;
  font-weight: bold;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* Išvykimo datos stilius kortelėje */
.departure-date {
  color: #666;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

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

/* Partnerių kortelės */
body.partner-page .card::after {
  content: attr(data-partner);
  display: block;
  background: #e74c3c;
  color: white;
  padding: 0.3rem;
  text-align: center;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Footeris */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(238, 246, 255, 0.9);
  margin-top: auto;
}

.footer .info {
  margin-bottom: 1rem;
}

.footer a {
  color: #0066cc;
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.3s;
}

.footer a:hover {
  color: #004080;
  text-decoration: underline;
}

.disclaimer {
  color: #666;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Bendri modalų stiliai */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: white;
  margin: auto;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 400px;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #0066cc;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.modal-content textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-content button {
  background: #0066cc;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.modal-content button:hover {
  background: #0052a3;
}

.close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #333;
}

/* Privacy Policy Modal */
.privacy-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
  line-height: 1.6;
}

.privacy-content h3 {
  color: #0066cc;
  margin: 1.5rem 0 0.8rem;
  font-size: 1.2rem;
}

.privacy-content ul {
  margin: 0.8rem 0;
  padding-left: 1.5rem;
}

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

.privacy-content a {
  color: #0066cc;
  text-decoration: none;
}

.privacy-content a:hover {
  text-decoration: underline;
}

/* FAQ Modal */
#faq-modal .modal-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.faq-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
}

.faq-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-item h3 {
  color: #0066cc;
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.faq-item p {
  line-height: 1.6;
  color: #333;
}

.faq-content a {
  color: #0066cc;
  text-decoration: none;
}

.faq-content a:hover {
  text-decoration: underline;
}

/* About Us Modal */
.about-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  line-height: 1.6;
}

.about-content h2 {
  color: #0066cc;
  margin-bottom: 1rem;
}

.about-content p {
  margin-bottom: 1rem;
}

/* Scrollbar styling */
.privacy-content::-webkit-scrollbar,
.faq-content::-webkit-scrollbar,
.about-content::-webkit-scrollbar {
  width: 8px;
}

.privacy-content::-webkit-scrollbar-track,
.faq-content::-webkit-scrollbar-track,
.about-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.privacy-content::-webkit-scrollbar-thumb,
.faq-content::-webkit-scrollbar-thumb,
.about-content::-webkit-scrollbar-thumb {
  background: #0066cc;
  border-radius: 4px;
}

.privacy-content::-webkit-scrollbar-thumb:hover,
.faq-content::-webkit-scrollbar-thumb:hover,
.about-content::-webkit-scrollbar-thumb:hover {
  background: #0052a3;
}

/* Partnerių filtrai */
.partner-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 1rem auto;
  max-width: 900px;
  flex-wrap: wrap;
  padding: 0 1rem;
}

/* Įspėjamasis pranešimas */
.info-message {
  text-align: center;
  padding: 15px;
  margin: 15px 140px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  border-radius: 5px;
  font-weight: bold;
  color: #333;
}

.info-message p {
  margin: 5px 0;
}

.info-message small {
  color: #666;
  font-weight: normal;
}

/* Autoriaus teisės */
.copyright {
  margin-top: 1rem;
  color: #666;
  font-size: 0.9rem;
  text-align: center;
}

/* Atsakomasis dizainas */
@media (max-width: 1200px) {
  .results {
    margin-left: 120px;
    margin-right: 120px;
  }
  .info-message {
    margin: 15px 120px;
  }
}

@media (max-width: 1024px) {
  .results {
    margin-left: 80px;
    margin-right: 80px;
  }
  .info-message {
    margin: 15px 80px;
  }
}

@media (max-width: 900px) {
  .results {
    margin-left: 20px;
    margin-right: 20px;
  }
  .info-message {
    margin: 15px 20px;
  }
}

@media (max-width: 768px) {
  .ads {
    display: none;
  }
  
  .results {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  
  .info-message {
    margin: 15px 1rem;
    padding: 12px;
  }
  
  .search-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-section input,
  .search-section select,
  .search-section input[type="date"] {
    width: 100%;
  }
  
  .top-bar {
    flex-direction: column;
    gap: 10px;
    padding: 1rem;
  }
  
  .auth-buttons {
    width: 100%;
    flex-direction: column;
  }
  
  .auth-buttons button {
    width: 100%;
    justify-content: center;
  }

  .facebook-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .partner-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-content {
    margin: 5% auto;
    padding: 1.5rem;
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 2rem;
  }
  
  .modal-content {
    margin: 10% auto;
    padding: 1.2rem;
  }

  .privacy-content,
  .faq-content,
  .about-content {
    max-height: 50vh;
  }
  
  .faq-item h3 {
    font-size: 1rem;
  }
  
  /* Mobile optimizavimas kompaktiškoms kortelėms */
  .results {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .card {
    min-height: 110px;
  }
  
  .card-content {
    padding: 0.5rem;
  }
}
