:root {
  --bg-color: #0f1115;
  --card-bg: #1a1d24;
  --text-color: #f0f2f5;
  --accent-color: #3b82f6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-bottom: 50px;
}

/* Keelab piltide kopeerimiseks lohistamise ja märgistamise */
img {
  -webkit-user-drag: none;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 20px; 
}

/* --- FIKSEERITUD JA SUJUVALT KAHANEV PÄIS (HEADER) --- */
.site-header {
  text-align: center;
  padding: 40px 0;
  background-color: #000000;
  margin-bottom: 40px;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);

  /* Püsib ekraani ülaservas paigal */
  position: sticky;
  top: 0;
  z-index: 100;
  
  /* Sujuv üleminek suuruse muutumisel */
  transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Oleks keritud päis (aktsendiga ja kompaktsem) */
.site-header.scrolled {
  padding: 15px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-logo-link {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.header-logo {
  max-width: 450px; /* Algne täissuurus */
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: max-width 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
}

/* Logo mõõt, kui lehte on keritud */
.site-header.scrolled .header-logo {
  max-width: 260px; /* Kahaneb kerimisel kompaktseks */
}

.header-logo-link:hover .header-logo {
  opacity: 0.9;
  transform: scale(1.02);
}

.back-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 15px;
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 0.8;
}

/* Albumite kaardid avalehel */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.album-card {
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-card:hover { 
  transform: translateY(-5px); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.cover-wrapper { 
  aspect-ratio: 16 / 10; 
  overflow: hidden; 
  background: #252932; 
}

.cover-wrapper img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}

.album-card h2 { 
  padding: 15px; 
  font-size: 1.2rem; 
  text-align: center; 
}

/* Pildigalerii vaade */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

.gallery-item {
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}

.gallery-item img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transition: transform 0.3s; 
}

.gallery-item:hover img { 
  transform: scale(1.05); 
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active { 
  display: flex; 
}

.lightbox-img { 
  max-width: 90%; 
  max-height: 85vh; 
  border-radius: 4px; 
}

.close, .prev, .next {
  position: absolute; 
  color: #fff; 
  font-size: 35px; 
  cursor: pointer;
  background: rgba(0,0,0,0.5); 
  border: none; 
  padding: 10px 18px; 
  border-radius: 6px;
  user-select: none;
}

.close { top: 20px; right: 20px; }
.prev { left: 20px; top: 50%; transform: translateY(-50%); }
.next { right: 20px; top: 50%; transform: translateY(-50%); }

.close:hover, .prev:hover, .next:hover { 
  background: var(--accent-color); 
}

/* JALUS (FOOTER) */
.site-footer {
  text-align: center;
  padding: 30px 20px;
  background-color: #111;
  color: #fff;
  margin-top: 60px;
}

.social-links {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-radius: 50%;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
}

.social-links a[title="Facebook"]:hover {
  background-color: #1877F2;
  color: #fff;
}

.social-links a[title="Instagram"]:hover {
  background-color: #E4405F;
  color: #fff;
}

/* KONTAKTI VORMI STIILID */
.contact-section {
  max-width: 600px;
  margin: 60px auto 20px;
  padding: 30px;
  background-color: var(--card-bg, #1a1a1a);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.contact-section h2 {
  margin-bottom: 8px;
}

.contact-section p {
  color: #aaa;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

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

.form-group label {
  font-size: 0.85rem;
  color: #ccc;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
}

.submit-btn {
  padding: 12px;
  background-color: #ffffff;
  color: #000000;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.submit-btn:hover {
  background-color: #e0e0e0;
}

.submit-btn:active {
  transform: scale(0.98);
}

.form-alert {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.form-alert.success {
  background-color: rgba(40, 167, 69, 0.2);
  border: 1px solid #28a745;
  color: #28a745;
}

.form-alert.error {
  background-color: rgba(220, 53, 69, 0.2);
  border: 1px solid #dc3545;
  color: #dc3545;
}

/* AI CHATI STIILID */
#ai-chat-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  font-family: inherit;
}

#chat-toggle-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#chat-toggle-btn:hover {
  transform: scale(1.08);
  background-color: #0056b3;
}

#chat-box {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  height: 420px;
  background-color: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

#chat-box.chat-closed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
}

.chat-header {
  background-color: #252525;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

#chat-close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

#chat-close-btn:hover {
  color: #fff;
}

.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.bot-message {
  background-color: #2a2a2a;
  color: #e0e0e0;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.user-message {
  background-color: #007bff;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.bot-message.loading {
  font-style: italic;
  opacity: 0.6;
}

.chat-input-area {
  display: flex;
  padding: 10px;
  background-color: #252525;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 6px;
}

#chat-input {
  flex: 1;
  background-color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-size: 0.85rem;
}

#chat-input:focus {
  outline: none;
  border-color: #007bff;
}

#chat-send-btn {
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

#chat-send-btn:hover {
  background-color: #0056b3;
}

/* Mobilise seadme kohandus */
@media (max-width: 480px) {
  .site-header {
    padding: 20px 0;
  }

  .header-logo {
    max-width: 280px;
  }

  .site-header.scrolled .header-logo {
    max-width: 200px;
  }

  #chat-box {
    width: calc(100vw - 40px);
    right: -10px;
  }
}
/* --- ALBUMI VAATE PÄISE KAHANEMINE KERIMISEL --- */

/* Vähendame tagasilingi all olevat vahet */
.site-header.scrolled .back-link {
  margin-bottom: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

/* Teeme albumi pealkirja kergelt väiksemaks ja tihedamaks */
.site-header.scrolled h1 {
  font-size: 1.3rem; /* Algne font on tavaliselt ~2rem */
  transition: all 0.3s ease;
}