
@font-face {
  font-family: "Source Code Pro";
  src: url("./fonts/SourceCodePro-Regular.ttf");
}
@font-face {
  font-family: "Clash font";
  src: url("./fonts/Clash-Bold.ttf");
}

@font-face {
  font-family: "Clash light";
  src: url("./fonts/Clash-Light.ttf");
}

:root {
  --primary-color: #f7b32b; /* Gold/Gem like */
  --secondary-color: #2d9cdb; /* Blue/Elixir like */
  --bg-overlay: rgba(20, 20, 20, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --text-color: #ffffff;
  --err-color: #ff4d4d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-image: url(./resources/background-mobile.webp);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-family: "Clash font", sans-serif;
  color: var(--text-color);
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

@media (min-width: 600px) {
  body {
    background-image: url("./resources/background.webp");
  }
}

.container {
  margin: auto;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  background-color: var(--glass-bg);
  border-radius: 1.5rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.title {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}

.parameters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  justify-items: center; /* Center items in the grid cells */
}

@media (max-width: 600px) {
    .parameters {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 0.5rem;
    }
    
    .container {
        width: 90%; /* Changed from 90vw to 90% */
        max-width: 90%;
        padding: 1rem;
        margin: 10px auto;
    }

    .title {
        font-size: 1.5rem;
    }
    
    /* Ensure no flex elements force width */
    #switch1, #switch2 {
        min-width: 0;
        width: 100%;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content within each group */
    justify-content: space-between; /* Push content to edges */
    height: 100%; /* Ensure full height for alignment */
    width: 100%;
}

.parameter {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex; /* Changed to flex for icon alignment */
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  flex-grow: 1; /* Allow label to take space */
}

.gemIconLabel {
    width: 32px; /* Increased from 20px */
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

.inputs {
  width: 12ch; /* Slightly wider */
  text-align: center;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-family: "Source Code Pro", monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
  color: #333;
}

.url {
  display: block;
  text-align: center;
  color: var(--secondary-color);
  text-decoration: none;
  font-family: "Source Code Pro", monospace;
  margin-top: 1rem; /* Reduced from 1.5rem */
  font-size: 1rem;
  transition: color 0.3s;
}

/* Specific styling for sliders to override text input styles */
/* Specific styling for sliders to override text input styles */
input[type="range"].slider-input {
    -webkit-appearance: none;
    appearance: none; /* Standard property */
    width: 100%;
    margin-top: 0.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
    height: auto;
    padding: 0;
}

input[type="range"].slider-input:focus {
    box-shadow: none;
    outline: none;
}

/* Slider Track */
input[type="range"].slider-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

input[type="range"].slider-input::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Slider Thumb */
input[type="range"].slider-input::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px; /* CENTER THUMB: (track height / 2) - (thumb height / 2) */
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    border: 2px solid white;
    transition: transform 0.1s ease;
}

input[type="range"].slider-input::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

input[type="range"].slider-input:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

input[type="range"].slider-input:active::-moz-range-thumb {
    transform: scale(1.2);
}

.inputs:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(45, 156, 219, 0.5);
}

.err {
  visibility: hidden;
  font-family: "Source Code Pro", monospace;
  font-size: 0.8rem;
  color: var(--err-color);
  margin-top: 0.25rem;
  height: 1.2em; /* Reserve space */
}

/* Switch Styling */
/* Switch/Checkbox Styling */
.switch {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 0.8rem;
    transition: background 0.3s;
}

.checkbox-group:hover {
    background: rgba(0,0,0,0.3);
}

.switchText {
    font-size: 0.9rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Custom Checkbox */
input[type="checkbox"].custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--secondary-color);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

input[type="checkbox"].custom-checkbox:checked {
    background: var(--secondary-color);
    box-shadow: 0 0 10px rgba(45, 156, 219, 0.5);
}

input[type="checkbox"].custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"].custom-checkbox:hover {
    border-color: #fff;
}

/* Calculate Button */
#calcBtn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #ffb303, #ff8c00);
  border: none;
  border-radius: 0.8rem;
  font-family: "Clash font", sans-serif;
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.4);
  transition: all 0.2s;
  text-transform: uppercase;
}

#calcBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.6);
}

#calcBtn:active {
  transform: translateY(1px);
}

/* Result Section */
.timeTaken {
  margin: 1rem auto; /* Reduced from 2rem auto */
  text-align: center;
  display: none;
  background: rgba(0,0,0,0.6);
  padding: 1.5rem;
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center; /* Center items vertically */
  gap: 2rem; /* Increased gap between the two result blocks */
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.timeIcon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
}

.timeTakenText { /* Legacy class, keeping just in case or for span styling if needed */
    font-size: 1.2rem;
    color: var(--primary-color);
}

.gemIcon{
    width: 40px;
    
}

.gemBoxIcon {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

#gemBox:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* About Page Specifics */
ul.parameters {
    list-style-type: none;
}

.tips {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: "Source Code Pro", monospace;
    line-height: 1.6;
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
  background: var(--glass-bg); /* Changed from dark rgba to match glass theme */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: "Source Code Pro", monospace;
  font-size: 0.85rem;
  color: #fff; /* Lighter text for better contrast on glass */
  border-top: 1px solid var(--glass-border);
  letter-spacing: 0.5px;
}

.footer span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.icon {
  width: 24px;
  height: 24px;
  filter: grayscale(100%) brightness(150%);
  transition: all 0.3s ease;
  opacity: 0.8;
}

.icon:hover {
  filter: grayscale(0%) brightness(100%);
  transform: scale(1.1);
  opacity: 1;
}


/* Chrome, Safari, Edge */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}