/* ==========================================================================
   1. VARIABLES & THEMES
   ========================================================================== */
:root {
    --bg-body: #020202;
    --bg-card: #1e1e1e;
    --bg-input: #2a2a2a;
    --text-main: #ffffff;
    --text-sub: #aaaaaa;
    --border: #444444;
    --accent: #4caf50;
    --btn-clr: #ffd000;
    --head: #ffffff;
    --logo-url: url('/img/logo-dark.png');
    --pro: #0BF7F9;
}

[data-theme="light"] {
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-input: #f8f9fa;
    --text-main: #1a1a1a;
    --text-sub: #666666;
    --border: #dddddd;
    --accent: #2e7d32;
    --head: #020202;
    --logo-url: url('/img/logo-light.png');
    --pro: #0583F9;
}

/* ==========================================================================
   2. BASE STYLES
   ========================================================================== */
body {
    font-family: -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.3s ease;
}

.card {
    background: var(--bg-card);
    padding: 0 20px 0 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: background 0.3s ease;
}

/* ==========================================================================
   3. TYPOGRAPHY & LINKS
   ========================================================================== */
h2,
h3,
h4 {
    color: var(--head);
    text-align: center;
    margin-top: 0;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
}

h3 {
    font-size: 1.5rem;
    margin: 35px 0 10px 0;
}

h4 {
    font-size: 1.5rem;
    margin: 20px 0 10px 0;
}

ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--head);
    text-transform: uppercase;
}

li {
    padding: 5px 0;
}

a:link,
a:visited {
    color: var(--head);
    text-decoration: none;
}

.pro {
    font-size: 0.85rem;
    color: var(--text-sub);
    text-align: center;
}

.footer-text {
    color: var(--head);
    font-size: 0.75rem;
    text-align: center;
    margin-top: 20px;
}

.feedback {
    margin: 20px 0;
    font-size: 0.85rem;
    color: var(--text-sub);
    text-align: center;
}

.feedback a {
    color: var(--text-sub);
}

.feedback a:hover {
    color: var(--head);
}

/* ==========================================================================
   4. FORM ELEMENTS & INPUTS
   ========================================================================== */
.input-group {
    width: 100%;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-sub);
    text-transform: uppercase;
    text-align: center;
}

select {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    font-size: 1.2rem;
    outline: none;
    cursor: pointer;
    text-align-last: center;
}

.elevation-input {
    width: 50%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-sub);
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    outline: none;
}

.elevation-input::-webkit-outer-spin-button,
.elevation-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ==========================================================================
   5. GRID & LAYOUT
   ========================================================================== */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.grid-lie {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.full-width {
    grid-column: span 2;
}

#pt {
    padding-top: 15px;
}

.reset {
    margin-top: 30px;
}

/* ==========================================================================
   6. COMPONENTS (STATS & BUTTONS)
   ========================================================================== */
.logo {
    content: var(--logo-url);
    width: 300px;
    height: auto;
    display: block;
    margin: 60px auto 20px auto;
}

.theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}

.ver-toggle {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    transition: opacity 0.2s ease;
}

.theme-toggle:hover,
.ver-toggle:hover {
    opacity: 0.8;
}

.stat-box {
    background: var(--bg-input);
    padding: 15px;
    border-radius: 10px;
    border-bottom: 4px solid var(--accent);
    text-align: center;
}

.stat-box.blue {
    border-bottom-color: #2196f3;
}

.stat-box.red {
    border-bottom-color: #f44336;
}

.stat-box.yellow {
    border-bottom-color: #ffd000;
}

.stat-box.white {
    border-bottom-color: #f0f0f0;
}

.label {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* ==========================================================================
   7. BUTTONS
   ========================================================================== */
button.clear {
    background: #f44336;
    padding: 15px;
    border-radius: 10px;
    border: none;
    text-align: center;
    width: 100%;
    grid-column: span 2;
    color: #ffffff;
    font-family: inherit;
    cursor: pointer;
    display: block;
    max-width: 400px;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

button.clear:hover {
    opacity: 0.9;
}

button.clear:active {
    transform: translateY(2px);
}

button.pro-btn {
    background: var(--bg-card);
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    border: 4px solid transparent;
    border-bottom: 4px solid var(--pro);

    text-align: center;
    width: 100%;
    grid-column: span 2;
    color: var(--head);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: block;
    max-width: 400px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.1s ease;
}

button.pro-btn:hover {
    background-color: var(--pro);
    color: #020202;
    border-color: var(--pro);
}

button.pro-btn:active {
    transform: translateY(2px);
}