* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.6s ease, color 0.6s ease;
}

.container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
    width: 600px;
    position: relative;
    transition: background 0.6s ease;
}

h1 {
    font-size: 1.8rem;
    color: #1e3a8a;
    margin-bottom: 25px;
}

h3 {
    color: #4e6ab7;
    margin-bottom: 25px;
}

.fontChanges {
    font-size: 17px;
}

button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

.color-box {
    margin-top: 25px;
    border: 2px dashed #60a5fa;
    height: 120px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black;
    font-size: 1.1rem;
    font-weight: 500;
    background-color: #f9fafb;
    transition: 0.5s;
}

.footer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #64748b;
}

/* 🌙 Dark Mode */
.dark {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #f8fafc;
}

.dark .container {
    background: rgba(30, 41, 59, 0.9);
    color: #f1f5f9;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
}

.dark .color-box {
    background-color: #334155;
    border-color: #60a5fa;
    color: #e2e8f0;
}

.switch {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 55px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* center properly */
    padding: 3px 5px;
    transition: background 0.4s ease;
    box-sizing: border-box;
}

.switch::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    transition: all 0.4s ease;
    transform: translateX(0);
    display: block;
    margin-left: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    align-self: center;
    /* ensure vertical centering */
}

.dark .switch {
    background: #1e40af;
}

.dark .switch::before {
    transform: translateX(27px);
    background: #facc15;
}


.moon {
    left: 8px;
    color: #334155;
    opacity: 1;
}

.sun {
    right: 8px;
    color: #facc15;
    opacity: 0;
}

/* Dark mode active */
.dark .switch {
    background: #1e40af;
}

.dark .switch::before {
    transform: translateX(26px);
    background: #facc15;
}

.dark .sun {
    opacity: 1;
}

.dark .moon {
    opacity: 0;
}