/* Default Light Mode Styles */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --link-color: #0073aa;
}

/* Dark Mode Global Variables */
body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --link-color: #3498db;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Image Optimization (Free Feature) */
body.dark-mode img {
    filter: brightness(.8) contrast(1.2);
}

/* Background Overlay for Dark Mode */
body.dark-mode [style*="background-image"]::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

/* Toggle Switch Styling */
.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input { display:none; }

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(26px); }

.slider .icon {
    position: absolute;
    top: 7px;
    font-size: 14px;
}
.sun { left: 8px; }
.moon { right: 8px; }