/* 
 * Film Photography Educational Website
 * Ansel Adams-inspired Black and White Design
 */

/* Base styles and typography */
:root {
  --primary-dark: #1a1a1a;
  --secondary-dark: #333333;
  --light-gray: #e0e0e0;
  --off-white: #f5f5f5;
  --accent: #8c8c8c;
  --text-color: #262626;
  --link-color: #4a4a4a;
  --link-hover: #000000;
  --header-font: 'Georgia', serif;
  --body-font: 'Helvetica Neue', Arial, sans-serif;
  --success-color: #4CAF50;
  --warning-color: #FFC107;
  --error-color: #F44336;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--off-white);
  max-width: 100%;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  margin-bottom: 1rem;
  font-weight: normal;
  line-height: 1.2;
  color: var(--primary-dark);
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 2rem;
  margin-top: 2rem;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.3rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Layout */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1rem;
}

.col {
  flex: 1;
  padding: 0 1rem;
}

/* Header */
header {
  background-color: var(--primary-dark);
  color: var(--off-white);
  padding: 1rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.site-title {
  font-size: 1.8rem;
  margin: 0;
  padding: 0;
  border: none;
}

.site-title a {
  color: var(--off-white);
  text-decoration: none;
}

/* Navigation */
nav {
  background-color: var(--secondary-dark);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--off-white);
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  display: block;
  padding: 1rem;
  color: var(--off-white);
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.nav-menu a:hover {
  background-color: var(--accent);
  text-decoration: none;
}

.nav-menu .active a {
  background-color: var(--accent);
  font-weight: bold;
}

/* Hero section */
.hero {
  background-color: var(--primary-dark);
  color: var(--off-white);
  padding: 4rem 0;
  text-align: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--off-white);
  border-bottom: none;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* Main content */
main {
  padding: 2rem 0;
}

.section {
  margin-bottom: 3rem;
}

/* Cards */
.card {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card h3 {
  margin-top: 0;
}

/* Images */
.img-container {
  margin-bottom: 1.5rem;
  text-align: center;
}

.img-fluid {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--accent);
}

.img-caption {
  font-size: 0.9rem;
  color: var(--accent);
  text-align: center;
  margin-top: 0.5rem;
}

/* Topic content */
.topic-content {
  max-width: 800px;
  margin: 0 auto;
}

.topic-section {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--light-gray);
}

.topic-section:last-child {
  border-bottom: none;
}

.principles-list, .tips-list, .mistakes-list, .examples-list {
  list-style-type: disc;
  margin-left: 1.5rem;
}

/* Interactive elements */
.btn {
  display: inline-block;
  background-color: var(--secondary-dark);
  color: var(--off-white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: var(--primary-dark);
  text-decoration: none;
}

.btn:disabled {
  background-color: var(--light-gray);
  color: var(--accent);
  cursor: not-allowed;
}

/* Quiz and Flashcards */
.quiz-container, .flashcard-container {
  max-width: 800px;
  margin: 0 auto;
}

.quiz-question-container {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.quiz-progress {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.quiz-question {
  margin-bottom: 2rem;
}

.quiz-options {
  list-style-type: none;
  margin-left: 0;
}

.quiz-option {
  background-color: white;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.quiz-option:hover {
  background-color: var(--light-gray);
}

.quiz-option.selected {
  background-color: var(--accent);
  color: white;
}

.quiz-option.correct-selection {
  background-color: rgba(76, 175, 80, 0.2);
  border-color: var(--success-color);
}

.quiz-option.incorrect-selection {
  background-color: rgba(244, 67, 54, 0.2);
  border-color: var(--error-color);
}

.quiz-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.quiz-result-container {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.quiz-score {
  text-align: center;
  margin-bottom: 2rem;
}

.quiz-message {
  font-weight: bold;
  margin-top: 0.5rem;
}

.quiz-detailed-results {
  margin-top: 2rem;
}

.quiz-result-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 4px;
}

.quiz-result-item.correct {
  background-color: rgba(76, 175, 80, 0.1);
  border-left: 4px solid var(--success-color);
}

.quiz-result-item.incorrect {
  background-color: rgba(244, 67, 54, 0.1);
  border-left: 4px solid var(--error-color);
}

.quiz-result-item h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.explanation {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent);
}

.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.quiz-performance-summary {
  background-color: var(--light-gray);
  padding: 1.5rem;
  border-radius: 4px;
  margin: 2rem 0;
}

.strengths, .improvements {
  margin-top: 1rem;
}

.quiz-history {
  margin: 2rem 0;
}

.quiz-history-scores {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.history-item {
  text-align: center;
  flex: 1;
}

.history-attempt {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
}

.history-score {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
}

.quiz-progress-tracker {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.topic-progress {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.topic-name {
  width: 200px;
  font-weight: bold;
}

.progress-bar-container {
  flex: 1;
  height: 20px;
  background-color: var(--light-gray);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background-color: var(--secondary-dark);
  border-radius: 10px;
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-color);
}

.quiz-topic-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Flashcards */
.flashcard {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.flashcard-count {
  margin: 0 1rem;
}

.flashcard-progress {
  margin: 20px 0;
}

.progress-bar {
  height: 10px;
  background-color: var(--light-gray);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}

.progress-known {
  height: 100%;
  background-color: var(--success-color);
}

.progress-review {
  height: 100%;
  background-color: var(--warning-color);
}

.progress-new {
  height: 100%;
  background-color: var(--secondary-dark);
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 0.9rem;
}

.known-stat {
  color: var(--success-color);
}

.review-stat {
  color: var(--warning-color);
}

.new-stat {
  color: var(--secondary-dark);
}

.flashcard.status-known {
  border-left: 4px solid var(--success-color);
}

.flashcard.status-review {
  border-left: 4px solid var(--warning-color);
}

.flashcard.status-new {
  border-left: 4px solid var(--secondary-dark);
}

.known-card {
  animation: flash-green 0.5s;
}

.review-card {
  animation: flash-yellow 0.5s;
}

@keyframes flash-green {
  0%, 100% { background-color: white; }
  50% { background-color: rgba(76, 175, 80, 0.3); }
}

@keyframes flash-yellow {
  0%, 100% { background-color: white; }
  50% { background-color: rgba(255, 193, 7, 0.3); }
}

/* Glossary styles */
.glossary-section {
  margin: 40px 0;
  padding: 20px;
  background-color: var(--off-white);
  border-radius: 4px;
}

.glossary-header {
  margin-bottom: 20px;
}

.glossary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.glossary-filter {
  background-color: var(--light-gray);
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.glossary-filter.active {
  background-color: var(--secondary-dark);
  color: var(--off-white);
}

#glossary-search {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
}

.glossary-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
  padding: 10px;
  background-color: var(--light-gray);
  border-radius: 4px;
}

.glossary-alphabet a {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  background-color: var(--off-white);
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s;
}

.glossary-alphabet a:hover {
  background-color: var(--secondary-dark);
  color: var(--off-white);
}

.glossary-letter-section {
  margin-bottom: 30px;
}

.glossary-letter-section h3 {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.glossary-terms-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.glossary-term {
  position: relative;
  padding: 10px 15px;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.glossary-term:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.glossary-term .term {
  font-weight: bold;
  color: var(--primary-dark);
}

.glossary-term .definition {
  display: none;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--light-gray);
}

.glossary-term:hover .definition,
.glossary-term.active .definition {
  display: block;
}

.category-tag {
  display: inline-block;
  padding: 3px 8px;
  margin-top: 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  background-color: var(--light-gray);
}

.glossary-tooltip {
  position: relative;
  border-bottom: 1px dotted var(--accent);
  cursor: help;
}

.glossary-tooltip .tooltip-content {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-dark);
  color: var(--off-white);
  text-align: center;
  padding: 10px;
  border-radius: 4px;
  width: 250px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: normal;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.glossary-tooltip .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--primary-dark) transparent transparent transparent;
}

.glossary-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Test Your Eye feature */
.test-your-eye-container {
  margin: 40px 0;
  padding: 20px;
  background-color: var(--off-white);
  border-radius: 4px;
}

.test-your-eye-header {
  margin-bottom: 30px;
  text-align: center;
}

.test-your-eye-challenges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.test-your-eye-card {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.test-your-eye-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.test-your-eye-card h3 {
  padding: 15px;
  margin: 0;
  text-align: center;
  border-bottom: 1px solid var(--light-gray);
}

.challenge-image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.challenge-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s;
}

.test-your-eye-card:hover .challenge-image {
  filter: brightness(0.8);
}

.challenge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s;
}

.test-your-eye-card:hover .challenge-overlay {
  opacity: 1;
}

/* Challenge modal */
.challenge-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.challenge-modal.show {
  opacity: 1;
}

.challenge-modal-content {
  background-color: white;
  border-radius: 4px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Film comparison tool */
.film-comparison-tool {
  margin: 40px 0;
  padding: 20px;
  background-color: var(--off-white);
  border-radius: 4px;
}

.film-comparison-header {
  margin-bottom: 30px;
  text-align: center;
}

.film-selection-form {
  background-color: white;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.aesthetic-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aesthetic-option {
  display: flex;
  align-items: center;
  background-color: var(--light-gray);
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.aesthetic-option input {
  margin-right: 8px;
}

.btn-secondary {
  background-color: var(--light-gray);
  color: var(--text-color);
  margin-left: 10px;
}

.btn-secondary:hover {
  background-color: var(--accent);
  color: var(--off-white);
}

.film-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.film-card {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.film-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Keyboard shortcuts */
.keyboard-shortcuts {
  margin: 20px 0;
  padding: 15px;
  background-color: var(--light-gray);
  border-radius: 4px;
}

.keyboard-shortcuts h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.shortcuts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shortcuts-list li {
  display: flex;
  align-items: center;
  margin: 0;
}

kbd {
  display: inline-block;
  padding: 3px 6px;
  font-family: monospace;
  background-color: white;
  border: 1px solid var(--accent);
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0,0,0,.2);
  margin-right: 5px;
}

/* Animations and transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* Footer */
footer {
  background-color: var(--primary-dark);
  color: var(--off-white);
  padding: 2rem 0;
  text-align: center;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--light-gray);
}

footer a:hover {
  color: white;
}

/* Responsive styles */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .nav-container {
    flex-wrap: wrap;
  }
  
  .row {
    flex-direction: column;
  }
  
  .col {
    margin-bottom: 1.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .quiz-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .quiz-controls button {
    width: 100%;
  }
  
  .flashcard-nav {
    flex-direction: column;
    gap: 10px;
  }
  
  .flashcard-nav button {
    width: 100%;
  }
  
  .glossary-terms-list {
    grid-template-columns: 1fr;
  }
  
  .glossary-tooltip .tooltip-content {
    width: 200px;
    font-size: 0.8rem;
  }
  
  .aesthetic-options {
    flex-direction: column;
    gap: 5px;
  }
  
  .film-results, .film-comparison {
    grid-template-columns: 1fr;
  }
  
  .shortcuts-list {
    flex-direction: column;
    gap: 5px;
  }
  
  .topic-progress {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .topic-name {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .progress-bar-container {
    width: 100%;
  }
  
  .quiz-topic-btn {
    width: 100%;
    margin-top: 5px;
  }
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
    color: #000;
    background-color: #fff;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  header, nav, footer, .btn {
    display: none;
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 0;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
  
  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }
}