/* Virginia Algonquian Language Learning Interface Styles */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Cinzel:wght@400;600;700&display=swap');

:root {
  /* Native American theme colors based on the background image */
  --primary: #a06a42;       /* Earthy brown */
  --secondary: #5a7247;     /* Forest green */
  --accent: #e5b299;        /* Light terracotta */
  --light: #fcdec0;         /* Cream/Beige */
  --dark: #3d2b24;          /* Deep brown */
  --river: #5b7c99;         /* Blue-gray */
  --clay: #c55a34;          /* Terracotta red */
  --cream: #f7e7ce;         /* Lighter cream */
  --sand: #e8c38d;          /* Sandy beige */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Libre Baskerville', Georgia, serif;
}

body {
  padding: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Direct background image without overlay */
  background: url('background.png') no-repeat center center fixed;
  background-size: cover;
  color: var(--dark);
}

header {
  background-color: var(--primary);
  color: white;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-bottom: 6px solid var(--secondary);
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    45deg,
    var(--clay),
    var(--clay) 10px,
    var(--secondary) 10px,
    var(--secondary) 20px
  );
  opacity: 0.8;
}

.header-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.header-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: inline-block;
}

.header-link:hover {
  background-color: rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
  position: relative;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

h1::after {
  content: "";
  display: block;
  width: 80%;
  height: 3px;
  background: var(--accent);
  margin: 0.75rem auto;
  border-radius: 3px;
}

.intro {
  max-width: 800px;
  margin: 0 auto;
  padding: 0.5rem;
  text-align: center;
  line-height: 1.6;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  flex-grow: 1;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* STATS CONTAINER WITH BETTER CONTRAST */
.stats-container {
  width: 100%;
  max-width: 600px;
  margin-bottom: 2rem;
  background-color: rgba(255, 255, 255, 0.85); /* Increased opacity */
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--primary);
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 0 1rem;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--clay);
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
  font-family: 'Cinzel', serif;
}

.stat-label {
  font-size: 1rem;
  color: var(--dark);
  font-weight: 600;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);
}

.progress-container {
  width: 100%;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--primary);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar {
  height: 100%;
  background-color: var(--secondary);
  width: 0%;
  transition: width 0.4s ease;
  position: relative;
}

.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.2) 10px,
    rgba(255,255,255,0.2) 20px
  );
}

.category-selector {
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem;
}

.category-btn {
  background-color: var(--cream);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 0 1 auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.category-btn:hover {
  background-color: var(--sand);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-btn.active {
  background-color: var(--clay);
  color: white;
  font-weight: bold;
  border-color: var(--clay);
}

/* FLASHCARD STYLES - FIXED POSITIONING */
.card-container {
  width: 100%;
  max-width: 600px;
  height: 350px;
  perspective: 1200px;
  margin: 1.5rem 0 2.5rem;
  z-index: 10;
  position: relative;
}

.card {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(0,0,0,0.4);
  border-radius: 10px;
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: 10px;
}

.card-front {
  background-color: var(--sand);
  border: 6px solid var(--clay);
  z-index: 2;
}

.card-back {
  background-color: var(--cream);
  border: 6px solid var(--secondary);
  transform: rotateY(180deg);
  z-index: 1;
}

.card.flipped {
  transform: rotateY(180deg);
}

/* Card corner patterns matching screenshots */
.card-front::before,
.card-front::after,
.card-back::before,
.card-back::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  background: repeating-linear-gradient(
    45deg,
    var(--clay),
    var(--clay) 2px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.5;
}

.card-front::before {
  top: 0;
  left: 0;
  border-top-left-radius: 10px;
}

.card-front::after {
  top: 0;
  right: 0;
  border-top-right-radius: 10px;
}

.card-back::before {
  bottom: 0;
  left: 0;
  border-bottom-left-radius: 10px;
  background: repeating-linear-gradient(
    45deg,
    var(--secondary),
    var(--secondary) 2px,
    transparent 2px,
    transparent 4px
  );
}

.card-back::after {
  bottom: 0;
  right: 0;
  border-bottom-right-radius: 10px;
  background: repeating-linear-gradient(
    45deg,
    var(--secondary),
    var(--secondary) 2px,
    transparent 2px,
    transparent 4px
  );
}

/* Dashed line under source (as seen in screenshot) */
.source::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--clay),
    var(--clay) 4px,
    transparent 4px,
    transparent 8px
  );
  margin: 1rem auto 0;
}

.word {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--dark);
  font-family: 'Cinzel', serif;
}

.pronunciation {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: var(--clay);
}

.definition {
  font-size: 1.2rem;
  text-align: center;
  line-height: 1.5;
  color: var(--primary);
}

.source {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--secondary);
  font-style: italic;
}

.notes {
  font-size: 1.1rem;
  line-height: 1.5;
  max-height: 100px;
  overflow-y: auto;
  padding: 0.5rem;
  text-align: center;
  margin-top: 1rem;
  width: 100%;
  color: var(--primary);
}

.controls {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 600px;
}

.control-button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  flex: 1;
  min-width: 150px;
  max-width: 200px;
}

.control-button:hover {
  background-color: var(--clay);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.control-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.control-button:disabled {
  background-color: #aaa;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.control-button.learned {
  background-color: var(--secondary);
}

.control-button svg {
  margin-right: 0.5rem;
}

/* Symbol decoration */
.symbol {
  position: absolute;
  opacity: 0.15;
  z-index: 0;
}

.symbol-1 {
  top: 20%;
  left: 10%;
  width: 50px;
  height: 50px;
  border: 2px solid var(--clay);
  border-radius: 50%;
}

.symbol-2 {
  bottom: 15%;
  right: 15%;
  width: 30px;
  height: 30px;
  background-color: var(--secondary);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

footer {
  background-color: var(--primary);
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: auto;
  position: relative;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
}

footer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    45deg,
    var(--clay),
    var(--clay) 10px,
    var(--secondary) 10px,
    var(--secondary) 20px
  );
  opacity: 0.8;
}

/* Native American-themed button styling */
button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-family: 'Libre Baskerville', serif;
}

button:hover {
  background-color: var(--clay);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

button svg {
  margin-right: 0.5rem;
}

/* Responsive styles */
@media (max-width: 768px) {
  .card-container {
    height: 300px;
  }
  
  .word {
    font-size: 2rem;
  }
  
  .controls {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
  
  .control-button, button {
    width: auto;
    min-width: unset;
    max-width: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .category-selector {
    gap: 0.5rem;
  }
  
  .category-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .header-nav {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .card-container {
    height: 250px;
  }
  
  .word {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .controls {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .control-button, button {
    width: 100%;
  }
  
  .category-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Safari-specific styles */
@media not all and (min-resolution:.001dpcm) { 
  @supports (-webkit-appearance:none) {
    .card-front, .card-back {
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
    }
    
    .card-back {
      transform: rotateY(180deg);
    }
    
    .card.flipped {
      transform: rotateY(180deg);
    }
  }
}

/* Content page styling */
.content-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  margin-top: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.content-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-section h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-family: 'Cinzel', serif;
  position: relative;
  padding-bottom: 0.5rem;
}

.content-section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 3px;
  background-color: var(--accent);
  border-radius: 1.5px;
}

.content-section h3 {
  color: var(--secondary);
  margin: 1.5rem 0 0.75rem;
  font-family: 'Cinzel', serif;
}

.content-section p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.example-table th {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
}

.example-table th:first-child {
  border-top-left-radius: 8px;
}

.example-table th:last-child {
  border-top-right-radius: 8px;
}

.example-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--light);
}

.example-table tr:last-child td {
  border-bottom: none;
}

.example-table tr:nth-child(even) {
  background-color: var(--light);
}

.rule-card {
  background-color: var(--light);
  border-left: 4px solid var(--secondary);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

.rule-card h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
}

.audio-control {
  margin-top: 12px;
  text-align: center;
}

.audio-button {
  background-color: #563d2d;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.audio-button:hover {
  background-color: #6e4e3a;
}

.audio-button:disabled {
  background-color: #ccbbaa;
  cursor: not-allowed;
}

.card-back {
  overflow-y: visible !important;
}

.notes {
  line-height: 1.4 !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0.25rem !important;
}

