﻿/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* Global body transition */
body {
    margin: 0;
    padding: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
    font-family: 'Roboto', sans-serif;
}

/* Toggle container for collapsed mode */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    background-color: #ffffff;
    transition: background-color 0.4s ease;
}

.toggle-theme-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

/* Light mode icon (sun) on the left */
.icon-sun {
    position: absolute;
    top: 50%;
    left: 7px;
    transform: translateY(-50%);
    color: #333;
    font-size: 13px;
    transition: color 0.4s ease;
}

/* Moon icon (dark mode) on the right; hidden in light mode */
.icon-moon {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    color: #fff;
    font-size: 13px;
    display: none;
    transition: color 0.4s ease;
}

/* The knob itself */
.toggle-knob {
    position: absolute;
    top: 5px;
    left: 25px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #333;
    transition: left 0.4s ease, background-color 0.4s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hover effect for toggle */
.theme-toggle:hover {
    filter: brightness(1.05);
}

/* DARK MODE OVERRIDES */
body.dark-mode .theme-toggle {
    background-color: #2c2c2c;
}

body.dark-mode .icon-sun {
    display: none;
}

body.dark-mode .icon-moon {
    display: block;
}

body.dark-mode .toggle-knob {
    left: 5px;
    background-color: #fff;
}

/* Move it inside the collapsed side menu */
.side-menu.collapsed .theme-toggle-collapsed {
    display: flex;
    justify-content: center; /* Center within the collapsed menu */
    width: 100%;
    padding: 10px 0;
}

/* Adjust the toggle button to fit within the collapsed menu */
.side-menu.collapsed .theme-toggle {
    position: relative; /* No longer fixed */
    top: auto;
    right: auto;
    width: 50px;
    height: 30px;
    margin: 0 auto;
}
