/* =========================== */
/*        GLOBAL VARIABLES     */
/* =========================== */

:root {
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --text-color: #333333;
  --accent-color: #0056b3;
  --accent-hover: #003e7e;
  --border-radius: 10px;
  --transition-speed: 0.3s;
}

/* =========================== */
/*          BASE STYLES        */
/* =========================== */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
}

h1, h2, h3 {
  color: var(--accent-color);
  text-align: center;
}

h1 a {
  text-decoration: none;
  color: inherit;
}

p {
  line-height: 1.6;
}

/* =========================== */
/*         CONTAINERS          */
/* =========================== */

.container {
  background: var(--card-bg);
  padding: 30px;
  margin: 20px auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  max-width: 1000px;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 20px;
}

.div-buffer {
  height: 50px;
}

/* =========================== */
/*           TABLES            */
/* =========================== */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

th, td {
  padding: 12px;
  text-align: center;
  border: 1px solid #ddd;
}

th {
  background: var(--accent-color);
  color: #ffffff;
  font-size: 18px;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* =========================== */
/*        FORMS & INPUTS       */
/* =========================== */

label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: bold;
}

input[type="number"],
select {
  width: 100%;
  max-width: 250px;
  padding: 10px;
  margin: 8px 0;
  border: 2px solid #ccc;
  border-radius: var(--border-radius);
  transition: border-color var(--transition-speed);
  font-size: 16px;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--accent-color);
  outline: none;
}

select option {
  padding: 8px;
}

/* Dropdown option colors */
select option[value="grey"] {
  background-color: lightslategray;
  color:white;
}

select option[value="green"] {
  background-color: #3cb371;
  color:white;
}

select option[value="blue"] {
  background-color: #1e90ff;
  color:white;
}

select option[value="purple"] {
  background-color: #9370db;
  color:white;
}

select option[value="gold"] {
  background-color: gold;
  color:black;
}

/* =========================== */
/*           BUTTONS           */
/* =========================== */

button {
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  font-size: 18px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-speed), transform var(--transition-speed);
  margin: 5px;
}

button:hover {
  background-color: var(--accent-hover);
  transform: scale(1.05);
}

.calculate-btn {
  text-align: center;
  margin-top: 20px;
}

/* =========================== */
/*           RESULTS           */
/* =========================== */

.result, #comparison-result, #result {
  text-align: center;
  margin-top: 20px;
  font-size: 20px;
  font-weight: bold;
}

#result {
  white-space: pre-line;
  color: var(--text-color);
}

/* =========================== */
/*        COMPONENTS           */
/* =========================== */

.gear-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: center;
}

.gear-box {
  background: var(--card-bg);
  border: 2px solid #ccc;
  border-radius: var(--border-radius);
  padding: 20px;
  width: 350px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background-color var(--transition-speed);
}

.gear-box h2 {
  color: var(--accent-color);
  text-align: center;
  margin-bottom: 15px;
}

.gear-box form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.gear-box label {
  text-align: right;
  padding-right: 10px;
}

/* =========================== */
/*       RESPONSIVENESS        */
/* =========================== */

@media (max-width: 768px) {
  .gear-container {
    flex-direction: column;
    align-items: center;
  }

  .gear-box form {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
    font-size: 1.2rem;
  }

  th, td {
    padding: 8px;
  }
}

/* =========================== */
/*         MISC STYLES         */
/* =========================== */

.bold-text {
  font-weight: bold;
}

.home-icons {
  width: 50px;
  height: auto;
}

.equip-label {
  width: auto;
  vertical-align: middle;
}

.section {
  padding: 50px 20px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s, transform 0.8s;
}
.section-title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 30px;
  color: var(--accent-color);
}
.section.show {
  opacity: 1;
  transform: translateY(0);
}

.main-links {
  display: flex;
  justify-content: center;
  text-align: center;
  gap: 50px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}
.main-links a {
  width: 220px;
  height: 160px;
  background: linear-gradient(135deg, var(--card-bg), var(--bg-color));
  border: 2px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  font-size: 24px;
  color: var(--text-color);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.3s;
}
.main-links a:hover {
  transform: translateY(-8px);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 0 20px;
}
.card-icon img {
  width: 64px;
  height: 64px;
  transition: opacity 0.5s ease-in-out;
  opacity: 1;
}


.card {
  background: var(--card-bg);
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s, border-color 0.3s;
  min-height: 276px;
}
.card:hover {
  transform: scale(1.05);
  border-color: var(--accent-color);
}
.card h3 {
  margin-bottom: 10px;
  font-size: 20px;
}
.card p {
  font-size: 14px;
}

#backToTop {
  position: fixed;
  bottom: 40px;
  right: 20px;
  background-color: var(--accent-color);
  color: var(--text-color);
  padding: 10px 15px;
  font-size: 22px;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  width: auto;
}
#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}


.search-bar {
  text-align: center;
  margin-bottom: 30px;
}
.search-bar input {
  padding: 10px;
  width: 260px;
  border: 2px solid #ccc;
  border-radius: 6px;
}
.modal {
  position: fixed;
  z-index: 9999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg);
  border: 2px solid #ccc;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  padding: 20px;
  width: 90%;
  max-width: 500px;
  text-align: center;
}
.modal-content textarea {
  width: 100%;
  padding: 10px;
  border-radius: var(--border-radius);
  border: 1px solid #ccc;
  font-size: 1rem;
  resize: vertical;
}
.modal-buttons {
  margin-top: 15px;
}
.modal-buttons button {
  margin: 0 10px;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 9998;
}
.hidden {
  display: none;
}
.modal-content label {
  display: block;
  text-align: left;
  margin-top: 10px;
  margin-bottom: 4px;
  font-weight: bold;
}

.modal-content select,
.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  box-sizing: border-box;
}

.confirmation-message {
  margin-top: 15px;
  font-weight: bold;
  color: green;
  font-size: 1rem;
}
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #4BB543;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
}
.coffee-btn {
  background-color: #FFDD00;
  color: #000;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 16px;
  text-decoration: none;
  display: inline-block;
  margin-top: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background-color 0.3s;
}

.coffee-btn:hover {
  background-color: #ffcc00;
}
.hero-blurb {
  background: var(--card-bg);
  padding: 40px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: center;
  border-bottom: 2px solid #ccc;
}

.blurb-container {
  max-width: 800px;
  margin: 0 auto;
}

.hero-blurb h1 {
  font-size: 32px;
  color: var(--accent-color);
  margin-bottom: 10px;
}

.hero-blurb p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
}
