/*
================================================================================
  JUSTIFIED TRUE BELIEF - MAIN STYLESHEET
  An apologetics website organizing arguments for the truth of Christianity
================================================================================
  
  TABLE OF CONTENTS:
  1. Reset & Base Styles
  2. Typography & Fonts
  3. Layout & Container
  4. Header & Title Animation
  5. Sections & Subsections
  6. Syllogisms & Arguments
  7. Premise Styling & Info Icons
  8. Buttons & Interactive Elements
  9. Additional Content (Sources, Defeaters, Videos)
  10. Footer & Changelog
  11. JTB Logo & Playlist
  12. Font Awesome Icons
  13. Responsive Design (Media Queries)
  
================================================================================
*/


/* ============================================================================
   1. RESET & BASE STYLES
   ============================================================================ */

/* Universal box-sizing and consistent font/spacing reset */
* {
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
}

/* Enable smooth scrolling for better user experience when navigating sections */
html {
  scroll-behavior: smooth;
}

/* Body background with gradient and minimum height for full-page coverage */
body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  padding: 5px;
}


/* ============================================================================
   2. TYPOGRAPHY & FONTS
   ============================================================================ */

/* Font Awesome 6 Free - Regular weight (400) */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-regular-400.woff2) format("woff2"),
       url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-regular-400.ttf) format("truetype");
}

/* Font Awesome 6 Free - Solid weight (900) */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-solid-900.woff2) format("woff2"),
       url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-solid-900.ttf) format("truetype");
}

/* Font Awesome 6 Brands - Regular weight (400) */
@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-brands-400.woff2) format("woff2"),
       url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-brands-400.ttf) format("truetype");
}

/* Font Awesome CSS variables for different icon families */
:host, :root {
  --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";
  --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";
  --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";
}

/* Base styles for all Font Awesome icons */
.fab, .fas, .fa-regular {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  display: var(--fa-display, inline-block);
  font-style: normal;   /* Prevent italic slant on icons */
  font-variant: normal;
  line-height: 1;
  text-rendering: auto;
}

/* Solid icons (Font Awesome Free Solid) */
.fas {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

/* Brand icons (YouTube, etc.) */
.fab {
  font-family: "Font Awesome 6 Brands";
  font-weight: 400;
}

/* Regular icons (outlines) */
.fa-regular {
  font-family: "Font Awesome 6 Free";
  font-weight: 400;
}

/* Icon character mappings */
.fa-info-circle:before { content: "\f05a"; }
.fa-clock-rotate-left:before { content: "\f1da"; }
.fa-youtube:before { content: "\f167"; }
.fa-file-lines:before { content: "\f15c"; }
.fa-file-image:before { content: "\f1c5"; }


/* ============================================================================
   3. LAYOUT & CONTAINER
   ============================================================================ */

/* Main content container with white background and shadow */
.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  max-width: 900px;
  padding: 1rem;
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 100px; /* Space for fixed bottom elements */
}


/* ============================================================================
   4. HEADER & TITLE ANIMATION
   ============================================================================ */

/* Header section with gradient background */
header {
  background: linear-gradient(135deg, #3498db22 0%, #2c3e5022 100%);
  border-bottom: 2px solid #eee;
  border-radius: 10px;
  margin-bottom: 1rem;
  padding: 1rem 0.8rem;
  text-align: center;
}

/* Main heading (h1) - "Justified True Belief" */
h1 {
  color: #2c3e50;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

/* Subtitle text beneath header */
.subtitle {
  color: #666;
  font-size: 1rem;
  line-height: 1.4;
}

/* Container for each word in the animated title */
.title-word {
  display: inline-block;
  margin-right: 0.1em;
}

/* Initial letters that are always visible (J, T, B) */
.initial {
  opacity: 1;
}

/* Fade class for letters that animate in */
.fade {
  position: relative;
  opacity: 0;
  transform: translateY(100%);
}

/* Animation timing for "Justified" */
#word1 .fade {
  animation: slideUp 3s ease forwards 1s;
}

/* Animation timing for "True" */
#word2 .fade {
  animation: slideUp 3s ease forwards 2s;
}

/* Animation timing for "Belief" */
#word3 .fade {
  animation: slideUp 3s ease forwards 2.7s;
}

/* Keyframes for slide-up animation */
@keyframes slideUp {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}


/* ============================================================================
   5. SECTIONS & SUBSECTIONS
   ============================================================================ */

/* Main section and subsection containers */
.section, .subsection {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.3rem;
  overflow: hidden;
}

/* Clickable headers for sections and subsections */
.section-header, .subsection-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  padding: 0.5rem;
  text-align: center;
  transition: background-color 0.2s ease;
  user-select: none; /* Prevent text selection on repeated clicks */
}

/* Hover effect for section/subsection headers */
.section-header:hover, .subsection-header:hover {
  background-color: #f0f0f0;
  border-radius: 8px;
}

/* Section and subsection content - hidden by default */
.section-content, .subsection-content, .argument-content {
  display: none; /* JavaScript toggles this */
  padding: 0.5rem;
}

/* Section heading (h2) - e.g., "Natural Theology" */
.section h2, .subsection h3, .subsection h4 {
  margin: 0;
  color: #2c3e50;
  font-weight: 700;
}

.section h2 {
  font-size: 1.8rem;
}

/* Subsection header styling */
.subsection-header {
  font-size: 1rem;
  margin: 0 auto;
  max-width: 90%;
}

/* Subsection heading (h3) - e.g., "Cosmological" */
.subsection h3 {
  color: #2c3e50b5; /* Slightly transparent blue-gray */
  font-size: 1.3rem;
}

/* Subheading text (italicized descriptive text) */
.section .subheading, .subsection .subheading {
  color: #666;
  font-size: 1rem;
  font-style: italic;
  text-align: center;
}


/* ============================================================================
   6. SYLLOGISMS & ARGUMENTS
   ============================================================================ */

/* Individual argument container */
.argument {
  background: #f8f9fa;
  border-radius: 6px;
  margin: 0.2rem auto;
  width: 100%;
  padding: 0.1rem 0;
  overflow: hidden;
}

/* Clickable argument header (h4) - e.g., "The Kalam Argument" */
.argument-header {
  font-size: 1rem;
  margin: 0 auto;
  max-width: 85%;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
}

.argument-header:hover {
  background-color: #f0f0f0;
  border-radius: 8px;
}

/* Syllogism container - holds premises and conclusion */
.syllogism {
  background: #fff;
  border-radius: 5px;
  margin: 0.3rem auto;
  padding: 0.6rem;
  padding-top: 0.3rem;
  text-align: left;
  max-width: 750px;
}

/* Each premise/conclusion paragraph */
.syllogism p {
  align-items: flex-start;
  color: #2c3e50;
  display: flex;
  margin: 0.6rem 0;
}

/* Divider line between syllogism sections */
.syllogism-divider {
  height: 1px;
  background-color: #d0d0d09e;
  margin: 15px auto;
  width: 70%;
}


/* ============================================================================
   7. PREMISE STYLING & INFO ICONS
   ============================================================================ */

/* Premise label (e.g., "(P1)", "(C1)") */
.premise {
  font-weight: 700;
  margin-right: 5px;
  min-width: 45px;
  color: #8fa3bf; /* Muted blue */
}

/* Premise text container */
.premise-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Row containing premise title and info icon */
.premise-title-row {
  display: inline;
  gap: 5px;
  opacity: 0;
  align-items: center;
  animation: fadeIn 1.6s forwards; /* Fade in on page load */
}

/* General fade-in animation */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Info icon (click to expand additional information) */
.info-icon {
  color: #3498db;
  cursor: pointer;
  font-size: 0.9em;
  padding-left: 5px;
  vertical-align: middle;
  margin-left: auto;
}

/* Additional information box (hidden by default, shown on icon click) */
.additional-info {
  background: #f1f1f1;
  border-radius: 5px;
  color: #2c3e50;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  padding: 0.6rem;
  text-align: left;
  display: none; /* JavaScript toggles this */
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  white-space: pre-wrap; /* Preserve formatting */
}


/* ============================================================================
   8. BUTTONS & INTERACTIVE ELEMENTS
   ============================================================================ */

/* Button group container */
.button-group {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* Base styles for all buttons */
.source-btn, .defeaters-btn, .youtube-btn {
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  transition: background-color 0.2s ease;
}

/* Source button (blue) */
.source-btn {
  background: #3498db;
}

.source-btn:hover {
  background: #2980b9;
}

/* Defeaters button (orange) */
.defeaters-btn {
  background: #f4a261;
}

.defeaters-btn:hover {
  background: #e76f51;
}

/* YouTube video button (red) */
.youtube-btn {
  background: #FF8A8A;
}

.youtube-btn:hover {
  background: red;
}

/* Infographic button (icon-only button with flip animation) */
.infographic-btn {
  color: #8FBFA1; /* Muted green */
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.7rem;
  padding: 0 2px;
  transition: color 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.infographic-btn:hover {
  color: #163865; /* Darker blue on hover */
  background: transparent;
}

.infographic-btn:focus {
  outline: none; /* Remove default focus box */
}

/* Flip animation for infographic icon on hover */
.fa-flip {
  display: inline-block;
  transition: transform 0.4s ease;
}

.infographic-btn:hover .fa-flip {
  transform: rotateY(180deg);
}


/* ============================================================================
   9. ADDITIONAL CONTENT (SOURCES, DEFEATERS, VIDEOS)
   ============================================================================ */

/* Source content box */
.source-content {
  background: #f1f1f1;
  border-radius: 5px;
  color: #2c3e50;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  padding: 0.6rem;
  text-align: left;
  display: none; /* JavaScript toggles this */
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  white-space: pre-wrap;
}

/* Defeaters content container */
.defeaters-content {
  background: #fff;
  border-radius: 5px;
  color: #2c3e50;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  padding: 0.6rem;
  text-align: left;
  display: none; /* JavaScript toggles this */
}

/* Individual defeater pair (defeater + counter) */
.defeater-pair {
  margin-bottom: 1rem;
}

/* Clickable defeater tab */
.defeater-tab {
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Expand/collapse icon (+ or -) */
.expand-icon {
  font-weight: 400;
  font-size: 1.5em;
  margin-right: 10px;
  display: inline-block;
  text-align: center;
  line-height: 1;
  flex-shrink: 0;
}

/* Defeater text box */
.defeater {
  background: #dbdbdb69; /* Light gray with transparency */
  border-radius: 9px;
  margin: 0;
  padding: 0.4rem;
  white-space: pre-wrap;
  font-size: 1rem;
  font-weight: 400;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

/* "Defeater" label prefix */
.defeater::before {
  content: "(Defeater) ";
  font-weight: 700;
  color: #f4a261; /* Orange */
  margin-right: 5px;
}

/* Counter-argument (defeater-defeater) */
.counter {
  border-radius: 3px;
  margin: 0.2rem 0 0.2rem 30px; /* Indented */
  padding: 0.4rem;
  white-space: pre-wrap;
  font-size: 1rem;
  border-left: 2px solid #c0c0c03d; /* Left border for visual hierarchy */
  opacity: 0;
  animation: fadeIn 1s forwards;
}

/* "Defeater-Defeater" label prefix */
.counter::before {
  content: "(Defeater-Defeater) ";
  font-weight: 700;
  color: #3498dbfa; /* Blue */
  margin-right: 5px;
}

/* Video content container (16:9 aspect ratio) */
.video-content {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  display: none; /* JavaScript toggles this */
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Embedded YouTube iframe */
.video-content iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* ============================================================================
   10. FOOTER & CHANGELOG
   ============================================================================ */

/* Footer section */
.footer {
  border-top: 2px solid #eee;
  margin-top: 1rem;
  padding-top: 1rem;
}

/* Footer title/header (clickable) */
.footer-title {
  background: linear-gradient(135deg, #3498db22 0%, #2c3e5022 100%);
  border-radius: 8px;
  color: #2c3e50;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  padding: 0.8rem;
  text-align: center;
}

.footer-title:hover {
  background-color: #f0f0f0;
}

/* Footer content box */
.footer-content {
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #2c3e50;
  display: none; /* JavaScript toggles this */
  margin-top: 0.3rem;
  max-width: 500px;
  padding: 1rem;
  text-align: left;
  width: 100%;
}

/* Footer icon (e.g., changelog icon) */
.footer-icon {
  color: #666;
  cursor: pointer;
  font-size: 1.2rem;
  margin-right: 10px;
  transition: color 0.2s ease;
}

.footer-icon:hover {
  color: #3498db;
}

/* Footer items container */
.footer-items {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 3rem;
  position: relative;
}

/* Changelog section */
.changelog {
  align-items: flex-end;
  display: flex;
  justify-content: flex-start;
  padding: 0 20px;
  position: relative;
  width: 100%;
}

/* Changelog container */
.changelog-container {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  padding: 10px;
  width: 50%;
}

/* Changelog content box (version history) */
.changelog-content {
  background-color: #edeff1;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #666;
  display: none; /* JavaScript toggles this */
  font-size: 0.85rem;
  margin-top: 25px;
  padding: 10px;
  text-align: left;
  position: absolute;
  width: 350px;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* Individual version log entry */
.version-log-entry {
  width: 100%;
  box-sizing: border-box;
  padding: 2px 0;
  margin-bottom: 0.3rem;
  display: flex;
}

/* Version number label */
.version {
  color: #666;
  font-weight: 700;
  margin-right: 5px;
  flex: 0 0 auto;
}

/* Remove margin from last entry */
.version-log-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}


/* ============================================================================
   11. JTB LOGO & PLAYLIST
   ============================================================================ */

/* JTB logo container (bottom-left) */
.jtb-logo-container {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translateY(100%);
  margin-left: 20px; /* Match playlist's right margin visually */
}

/* JTB logo plane image */
.jtb-logo-plane {
  height: 40px;
  width: auto;
  opacity: 0.8;
  border-radius: 5px;
}

/* Playlist button container (bottom-right) */
.playlist-btn-container {
  position: absolute;
  bottom: 0;
  right: 0;
  transform: translateY(100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
}

/* Playlist button (YouTube playlist link) */
.playlist-btn {
  background-color: #a73636;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 1.8rem;
  white-space: nowrap;
}

.playlist-btn:hover {
  background-color: red;
}

.playlist-btn i {
  margin-left: 5px;
}

/* Vertical line above playlist button */
.vertical-line {
  width: 2px;
  height: 20px;
  background-color: #666;
  margin-bottom: -1px;
}


/* ============================================================================
   12. FONT AWESOME ICONS
   ============================================================================ 
   (Already defined above in Typography section, kept here for organization) 
*/


/* ============================================================================
   13. RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================================================ */

/* Tablet and mobile devices (max-width: 768px) */
@media (max-width: 768px) {
  /* Reduce font sizes for smaller screens */
  .section .subheading,
  .subtitle {
    font-size: 0.9rem;
  }

  .section h2 {
    font-size: 1.3rem;
  }

  .section h3 {
    font-size: 1.1rem;
  }

  h1 {
    font-size: 2rem;
  }

  /* Adjust container spacing */
  .container {
    margin-bottom: 75px;
  }

  /* Reduce playlist button size */
  .playlist-btn {
    font-size: 1.4rem;
    padding: 8px 16px;
  }

  .vertical-line {
    height: 20px;
  }

  .playlist-btn-container {
    margin-right: 10px;
  }

  /* Simplify background for better mobile performance */
  body {
    background: #f5f7fa;
  }

  /* Speed up title animation on mobile */
  #word1 .fade {
    animation: slideUp 1.5s ease forwards 0.5s;
  }

  #word2 .fade {
    animation: slideUp 1.5s ease forwards 1s;
  }

  #word3 .fade {
    animation: slideUp 1.5s ease forwards 1.5s;
  }
}

/* ============================================================================
   END OF STYLESHEET
   ============================================================================ */
