:root {
    /* Sleek Dark Theme (Default) - Slate / Indigo Tint */
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --amount-color: #38bdf8;
    --border-color: #334155;
    --modal-bg: rgba(30, 41, 59, 0.85);
    
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-bg: #334155;
}

body.light-theme {
    /* Premium Light Theme - Soft Gray with Vibrant Accents */
    --bg-color: #f7f9fc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #2563eb;
    --amount-color: #2563eb;
    --border-color: #e2e8f0;
    --modal-bg: rgba(255, 255, 255, 0.85);
    
    --shadow-color: rgba(100, 116, 139, 0.15);
    --hover-bg: #f1f5f9;
}

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

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ------------------- Top Navigation ------------------- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    z-index: 50;
    position: relative;
}

.nav-left, .nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#settings-btn {
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.nav-btn:hover {
    background: var(--hover-bg);
}

.version-label {
    background: var(--hover-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ------------------- Main Display ------------------- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 18vh;
    position: relative;
    z-index: 20;
}

.salary-container {
    text-align: center;
}

.salary-container h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.amount-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.amount {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    color: var(--amount-color);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -2px;
}

.currency {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    color: var(--text-secondary);
}

/* ------------------- Miner Emoji ------------------- */
.miner-emoji {
    font-size: clamp(6rem, 15vw, 10rem);
    position: relative;
    z-index: 2;
    transform-origin: 80% 80%; /* Assume the handle of the pickaxe is at center bottom/right */
    animation: miningSwing 0.8s infinite alternate ease-in-out;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.4));
    margin-top: 2rem; /* Give space between salary and emoji */
}

@keyframes miningSwing {
    0% { transform: translateY(0) rotate(10deg); }
    100% { transform: translateY(30px) rotate(-45deg); }
}

/* ------------------- Motivational Quotes (Top Layer) ------------------- */
#motivational-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.floating-text {
    position: absolute;
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    font-weight: 800;
    color: var(--bg-color); 
    background: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px var(--shadow-color);
    animation: floatUpFade 4.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    white-space: nowrap;
}

@keyframes floatUpFade {
    0% { transform: translateY(20px); opacity: 0; }
    15% { transform: translateY(0px); opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(-40px); opacity: 0; }
}

/* ------------------- Modals ------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 40px var(--shadow-color);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    color: var(--text-primary);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content h2 {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 800;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 700;
}

input, select {
    width: 100%;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

body.light-theme input:focus, body.light-theme select:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.primary-btn {
    width: 100%;
    padding: 1.1rem;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, opacity 0.2s;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* ------------------- Media Queries ------------------- */
@media (max-width: 480px) {
    .top-nav {
        padding: 1.2rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    main {
        padding-top: 20vh;
    }
}
