/* style.css - Cabana Brie */

/* Import Google Fonts with full Romanian diacritic support */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Chromatic palette from specifications */
  --color-periwinkle: #94acfb;
  --color-olive: #727539;
  --color-taupe: #908575;
  --color-dark-olive: #675f07;
  --color-slate: #7c7c94;

  /* Custom rustic tones */
  --color-wood-dark: #3b2a18;
  --color-wood-medium: #594026;
  --color-wood-light: #7c5c3b;
  --color-wood-gold: #c5a059;
  --color-bg-cream: #e8ddd6;
  --color-bg-warm-center: #ddd0c8;
  --color-bg-ember: rgba(180, 72, 40, 0.06);
  --color-bg-moss: #1c1e10;
  --color-text-dark: #22221b;
  --color-text-muted: #55554f;
  --color-text-light: #faf8f5;
  
  /* Fonts */
  --font-title: 'Dancing Script', cursive;
  --font-body: 'Montserrat', sans-serif;
  
  /* Transitions & Shadows */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-wood: 0 10px 25px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.15);
  --shadow-soft: 0 4px 15px rgba(0,0,0,0.08);
}

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

body {
  font-family: var(--font-body);
  /* Warm grey base with ember-fire undertones */
  background-color: var(--color-bg-cream);
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(190, 90, 50, 0.10) 0%, rgba(160, 60, 30, 0.04) 40%, transparent 70%),
    radial-gradient(ellipse at 80% 80%, rgba(170, 70, 30, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 75%, rgba(190, 80, 40, 0.06) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z M30 10 L50 30 L30 50 L10 30 Z' fill='none' stroke='%23b84030' stroke-width='0.8' stroke-opacity='0.07'/%3E%3Crect x='28' y='28' width='4' height='4' fill='%23a83020' fill-opacity='0.08'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-size: 100% 100%, 100% 100%, 100% 100%, 60px 60px;
  background-attachment: fixed, fixed, fixed, fixed;
  color: var(--color-text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-cream);
}
::-webkit-scrollbar-thumb {
  background: var(--color-olive);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-dark-olive);
}

/* --- Romanian Traditional Motifs (SVG Backgrounds & Elements) --- */
.traditional-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  width: 100%;
  max-width: 600px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cpath d='M20 0 L40 10 L20 20 L0 10 Z M20 4 L32 10 L20 16 L8 10 Z' fill='%23727539'/%3E%3Ccircle cx='20' cy='10' r='2' fill='%23675f07'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 24px 12px;
}

.traditional-border-top {
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpolygon points='10,0 20,10 0,10' fill='%23675f07'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 14px 7px;
  opacity: 0.8;
}

/* --- Authentication Overlay --- */
#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-bg-moss);
  background-image: radial-gradient(circle at center, rgba(114, 117, 57, 0.2) 0%, transparent 70%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease-in-out;
}

#login-overlay.unlocked {
  transform: translateY(-100vh);
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background-color: rgba(34, 34, 27, 0.95);
  border: 2px solid var(--color-olive);
  border-radius: 12px;
  padding: 3rem 2.5rem;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

/* Decorative traditional corners inside the login card */
.login-card::before, .login-card::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-wood-gold);
  pointer-events: none;
}
.login-card::before {
  top: 15px;
  left: 15px;
  border-right: none;
  border-bottom: none;
}
.login-card::after {
  bottom: 15px;
  right: 15px;
  border-left: none;
  border-top: none;
}

.login-logo {
  font-family: var(--font-title);
  font-size: 3.5rem;
  color: var(--color-wood-gold);
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.login-slogan {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-slate);
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.input-group {
  position: relative;
}

.login-input {
  width: 100%;
  padding: 1rem 1.2rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-taupe);
  border-radius: 6px;
  color: var(--color-text-light);
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 4px;
  transition: var(--transition-smooth);
}

.login-input:focus {
  outline: none;
  border-color: var(--color-periwinkle);
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(148, 172, 251, 0.3);
}

.login-input::placeholder {
  letter-spacing: normal;
  color: var(--color-taupe);
  font-size: 0.9rem;
}

.login-button {
  background-color: var(--color-olive);
  color: var(--color-text-light);
  border: none;
  padding: 1rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.login-button:hover {
  background-color: var(--color-dark-olive);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.login-button:active {
  transform: translateY(0);
}

.error-message {
  color: #ff6b6b;
  font-size: 0.85rem;
  min-height: 20px;
  margin-top: -0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.error-message.visible {
  opacity: 1;
}

/* --- Main Layout --- */
#main-content {
  opacity: 0;
  transition: opacity 1s ease 0.4s;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

body.unlocked-page #main-content {
  opacity: 1;
}

/* --- Header Section --- */
header {
  text-align: center;
  padding: 5rem 1rem 3rem 1rem;
  position: relative;
}

.header-logo {
  font-family: var(--font-title);
  font-size: 5rem;
  color: var(--color-dark-olive);
  margin-bottom: 0.2rem;
  line-height: 1;
}

.header-slogan {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-olive);
  text-transform: uppercase;
  letter-spacing: 6px;
  margin-bottom: 2rem;
}

/* --- Generic Sections --- */
section {
  padding: 4rem 0;
  border-bottom: 1px solid rgba(144, 133, 117, 0.2);
}

section:last-of-type {
  border-bottom: none;
}

.section-title {
  text-align: center;
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--color-dark-olive);
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-taupe);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 3rem;
}

/* --- Geolocation Section --- */
.location-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.streetview-wrapper {
  width: 100%;
  max-width: 900px;
  height: 480px;
  background-color: var(--color-taupe);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 4px solid var(--color-text-light);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.streetview-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.gps-button {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background-color: var(--color-olive);
  color: var(--color-text-light);
  padding: 1.2rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(114, 117, 57, 0.3);
  transition: var(--transition-smooth);
}

.gps-button svg {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

.gps-button:hover {
  background-color: var(--color-dark-olive);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(103, 95, 7, 0.4);
}

/* --- Photo Gallery (Cronica Familiei) --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3.5rem;
  justify-content: center;
  padding: 1rem 0;
}

/* Virtual Wood Frame Styling */
.wood-frame {
  background: var(--color-bg-cream);
  padding: 24px; /* Space between frame and photo (matting/passepartout) */
  border-radius: 4px;
  position: relative;
  
  /* Wood Frame Outer Border: Multi-layered shadows and gradients simulating carved oak wood */
  border: 18px solid var(--color-wood-medium);
  border-image: linear-gradient(
    45deg,
    #3b2a18 0%, 
    #594026 25%, 
    #44311d 50%, 
    #7c5c3b 75%, 
    #3b2a18 100%
  ) 18;
  
  box-shadow: 
    0 15px 35px rgba(0,0,0,0.35), 
    inset 0 0 15px rgba(0,0,0,0.8), 
    0 2px 2px rgba(255,255,255,0.1);
  
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

/* Inner golden/antique border of the frame */
.wood-frame::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid var(--color-wood-gold);
  pointer-events: none;
  opacity: 0.6;
  z-index: 10;
}

/* Mitre joint line effects for the wooden corners */
.wood-frame::after {
  content: '';
  position: absolute;
  top: -18px;
  left: -18px;
  right: -18px;
  bottom: -18px;
  background-image: 
    linear-gradient(135deg, transparent 48%, rgba(0,0,0,0.4) 49%, rgba(0,0,0,0.4) 51%, transparent 52%),
    linear-gradient(45deg, transparent 48%, rgba(0,0,0,0.4) 49%, rgba(0,0,0,0.4) 51%, transparent 52%);
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 11;
  opacity: 0.3;
}

.photo-container {
  width: 100%;
  height: 240px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0,0,0,0.15);
  background-color: #e8e5dc;
}

.photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  filter: sepia(0.15) contrast(1.05); /* Cozy vintage/warm lookup */
}

/* Placeholder gri simplu — înlocuiți cu <img src="..."> când aveți pozele */
.photo-placeholder {
  background-color: #c9c2bb;
}

.frame-label {
  margin-top: 1.2rem;
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--color-wood-dark);
  line-height: 1.2;
}

.frame-date {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-taupe);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* Hover effects for the wood frame */
.wood-frame:hover {
  transform: translateY(-8px) scale(1.02) rotate(0.5deg);
  box-shadow: 
    0 22px 45px rgba(0,0,0,0.4), 
    inset 0 0 10px rgba(0,0,0,0.6);
}

.wood-frame:hover .photo-container img {
  transform: scale(1.08);
  filter: sepia(0) contrast(1.1);
}

/* Slight tilt variation for organic look on grid items */
.gallery-grid div:nth-child(even) .wood-frame {
  transform: rotate(-0.5deg);
}
.gallery-grid div:nth-child(even) .wood-frame:hover {
  transform: translateY(-8px) scale(1.02) rotate(0.5deg);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 4rem 1rem;
  margin-top: 4rem;
  border-top: 2px solid var(--color-olive);
  position: relative;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--color-slate);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logout-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--color-olive);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: var(--transition-smooth);
}

.logout-link:hover {
  color: var(--color-dark-olive);
  text-decoration: underline;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .header-logo {
    font-size: 4rem;
  }
  
  .header-slogan {
    font-size: 0.9rem;
    letter-spacing: 4px;
  }
  
  .section-title {
    font-size: 2.4rem;
  }
  
  .streetview-wrapper {
    height: 320px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin: 0 auto;
    gap: 3rem;
  }
  
  .wood-frame {
    border-width: 14px;
    padding: 16px;
  }
  
  .photo-container {
    height: 200px;
  }
  
  .gps-button {
    padding: 1rem 2rem;
    font-size: 0.9rem;
  }
}

/* Side Romanian traditional borders on large displays to fill empty space */
@media (min-width: 1400px) {
  body::before, body::after {
    content: '';
    position: fixed;
    top: 0;
    width: 40px;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    opacity: 0.25;
  }
  body::before {
    left: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M15 0 L30 15 L15 30 L0 15 Z M15 5 L25 15 L15 25 L5 15 Z' fill='none' stroke='%23675f07' stroke-width='1'/%3E%3Crect x='13' y='13' width='4' height='4' fill='%23727539'/%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-size: 24px 24px;
    background-position: center;
  }
  body::after {
    right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M15 0 L30 15 L15 30 L0 15 Z M15 5 L25 15 L15 25 L5 15 Z' fill='none' stroke='%23675f07' stroke-width='1'/%3E%3Crect x='13' y='13' width='4' height='4' fill='%23727539'/%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-size: 24px 24px;
    background-position: center;
  }
}
