/* HTML/CSS W2 Project
* Work in pairs
* Mark up your content with semantic html
* Lay out your page using flexbox and grid
* Test your work with Devtools.
* You can get pictures and choose custom size in the download at
* https://www.pexels.com/ 
* If you want to use a different font, get them from
* https://fonts.google.com/
*/

/* Testing your work 
== check your CSS
* uses grid
* uses flexbox
* uses at least one media query

== check your HTML
* uses semantic HTML
* has a Lighthouse Access score of 100 <-- 
* works on desktop and mobile
* works when you size the text up by 200%

== check your design
* follows the example
* you can choose your own colours and fonts if you like
* write your names at the bottom
* take a screenshot at laptop and Moto G4 device sizes in Devtools
*/

body {
  font:
    100% "Poppins",
    sans-serif;
}

/* HTML/CSS W2 Project
 * Mobile-first design with flexbox and grid
 * Semantic HTML with full accessibility
 * Responsive layout tested on multiple devices
 */

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

body {
  font:
    100% "Poppins",
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

/* Header Styles */
header {
  text-align: center;
  color: white;
  padding: 30px 20px;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

header p {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.95;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 0 auto;
}

/* Mobile-first: Flexbox for stacking */
.cards-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 40px;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h2 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.4rem;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

.card.card-completed {
  border: 3px solid #27ae60;
}

.card.card-failed {
  border: 3px solid #e74c3c;
  opacity: 0.8;
}

/* Statement Styles */
.statement {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  margin-bottom: 12px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  position: relative;
  transition: all 0.3s ease;
}

.statement-text {
  flex: 1;
  font-size: 1rem;
  line-height: 1.6;
}

.main-text {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.reveal-text {
  display: none;
  font-size: 0.9rem;
  color: #667eea;
  font-style: italic;
  margin-top: 8px;
  padding: 8px 12px;
  background: #e8eaf6;
  border-radius: 6px;
  animation: slideDown 0.4s ease;
}

.statement.revealed .reveal-text {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button-group {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

/* Button Styles */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-truth {
  background: #4a90e2;
  color: white;
}

.btn-truth:hover:not(:disabled) {
  background: #357abd;
  transform: scale(1.05);
}

.btn-lie {
  background: #e74c3c;
  color: white;
}

.btn-lie:hover:not(:disabled) {
  background: #c0392b;
  transform: scale(1.05);
}

.btn.correct {
  background: #27ae60 !important;
  animation: pulse 0.5s ease;
}

.btn.incorrect {
  background: #e74c3c !important;
  animation: shake 0.5s ease;
}

.statement.blink-correct {
  animation: blinkGreen 1s ease 3;
  border-left-color: #27ae60;
}

.statement.locked {
  opacity: 0.6;
  background: #e9ecef;
}

.statement.locked .main-text {
  text-decoration: line-through;
  color: #6c757d;
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

@keyframes blinkGreen {
  0%,
  100% {
    background: #f8f9fa;
  }
  50% {
    background: #d4edda;
    border-left-color: #27ae60;
  }
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f0f;
  animation: confettiFall 1s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100px) rotate(360deg);
    opacity: 0;
  }
}

/* Score Board */
.score-board {
  background: white;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
}

.score-board h2 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.score-display {
  font-size: 2rem;
  font-weight: 700;
  color: #27ae60;
  margin-bottom: 10px;
}

/* Results Section */
.result-section {
  display: none;
  background: white;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
}

.result-section.show {
  display: block;
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-section h2 {
  color: #667eea;
  font-size: 2rem;
  margin-bottom: 20px;
}

.result-section p {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #555;
}

.result-gif {
  max-width: 400px;
  width: 100%;
  border-radius: 10px;
  margin: 20px auto;
  display: block;
}

.reset-btn {
  background: #667eea;
  color: white;
  padding: 15px 40px;
  border: none;
  border-radius: 10px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.reset-btn:hover {
  background: #764ba2;
  transform: scale(1.05);
}

/* Footer */
footer {
  text-align: center;
  color: white;
  padding: 30px 20px;
  margin-top: 40px;
}

footer h3 {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.95;
}

/* Media Query: Tablet (768px and up) - Grid with 2 columns */
@media (min-width: 768px) {
  .cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .card:last-child {
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  header h1 {
    font-size: 3rem;
  }

  .statement {
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
  }

  .statement-text {
    flex: 1;
  }

  .button-group {
    flex-shrink: 0;
  }
}

/* Media Query: Desktop (1024px and up) - Grid with 3 columns */
@media (min-width: 1024px) {
  .cards-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .card:nth-child(4),
  .card:nth-child(5) {
    grid-column: auto;
  }

  .card:last-child {
    grid-column: auto;
    max-width: none;
  }
}
