/* =========================
   RESET & SYSTEM FEEL
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont,
                 "San Francisco", "Segoe UI", Roboto, Arial, sans-serif;
}

/* =========================
   BODY & THEME TRANSITION
   ========================= */
body {
    min-height: 100vh;
    background: linear-gradient(180deg, #f5f5f7, #e5e5ea);
    display: flex;
    justify-content: center;
    align-items: center;

    /* ⬇️ Slow, smooth transition */
    transition:
        background 0.8s ease,
        color 0.8s ease;
}

body.dark {
    background: linear-gradient(180deg, #1c1c1e, #2c2c2e);
}

/* =========================
   DARK MODE TOGGLE
   ========================= */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-toggle button {
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;

    background: rgba(255, 255, 255, 0.65);
    color: #1c1c1e;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition:
        background 0.6s ease,
        color 0.6s ease;
}

body.dark .theme-toggle button {
    background: rgba(44, 44, 46, 0.8);
    color: #f5f5f7;
}

/* =========================
   APP CONTAINER
   ========================= */
#app {
    width: 340px;
    padding: 26px;
    border-radius: 20px;
    text-align: center;

    transition:
        background 0.8s ease,
        box-shadow 0.8s ease;
}

/* =========================
   APPLE GLASS
   ========================= */
.glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.12);
}

body.dark .glass {
    background: rgba(28, 28, 30, 0.85);
    border-color: rgba(255, 255, 255, 0.06);
}

/* =========================
   TYPOGRAPHY
   ========================= */
h1 {
    font-size: 1.55rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1c1c1e;
    transition: color 0.8s ease;
}

p {
    font-size: 0.9rem;
    margin-bottom: 16px;
    color: #6e6e73;
    transition: color 0.8s ease;
}

.heading {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #3a3a3c;
    transition: color 0.8s ease;
}

body.dark h1 {
    color: #f5f5f7;
}

body.dark p,
body.dark .heading {
    color: #aeaeb2;
}

/* =========================
   INPUT
   ========================= */
input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    margin-bottom: 16px;

    background: rgba(255, 255, 255, 0.85);
    color: #1c1c1e;

    transition:
        background 0.6s ease,
        color 0.6s ease,
        box-shadow 0.3s ease;
}

body.dark input[type="number"] {
    background: rgba(44, 44, 46, 0.9);
    color: #f5f5f7;
}

input[type="number"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.35);
}

/* =========================
   FROM / TO BOXES
   ========================= */
.choice-box {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 16px;
    text-align: left;

    background: rgba(255, 255, 255, 0.8);
    transition: background 0.8s ease;
}

body.dark .choice-box {
    background: rgba(44, 44, 46, 0.85);
}

.choice-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.95rem;
    color: #1c1c1e;
    cursor: pointer;
    transition: color 0.8s ease;
}

body.dark .choice-box label {
    color: #f5f5f7;
}

/* =========================
   RADIO BUTTONS (macOS blue)
   ========================= */
input[type="radio"] {
    accent-color: #0a84ff;
    cursor: pointer;
}

/* =========================
   CONVERT BUTTON
   ========================= */
#convertBtn {
    width: 100%;
    padding: 13px;
    margin-top: 6px;
    border-radius: 14px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;

    background: linear-gradient(180deg, #0a84ff, #006edc);
    color: #ffffff;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.8s ease;
}

#convertBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(10, 132, 255, 0.45);
}

/* =========================
   RESULT
   ========================= */
.result {
    margin-top: 14px;
    min-height: 32px;
    font-size: 1.2rem;
    font-weight: 600;

    opacity: 0;
    transform: translateY(10px);

    transition:
        opacity 0.6s ease,
        transform 0.6s ease,
        color 0.8s ease;
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

.result.success {
    color: #34c759; /* Apple green */
}

.result.error {
    color: #ff453a; /* Apple red */
}

/* =========================
   SMOOTH APP ENTRY
   ========================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
