/* =================================================================== */
/* --- General Resettable and Utility Styles --- */
/* =================================================================== */
* {
    box-sizing: border-box;
}

:root {
    /* Main color palette and shadows */
    --primary-color: #4b5563;
    --secondary-color: #1f2937;
    --accent-color: #2563eb;
    --main-color: #f0f1f2;
    --dark-color: #212529;
    --light-bg-color: #f9fafb;
    --card-bg-color: #ffffff;
    --border-color: #e5e7eb;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* UI component sizing and colors */
    --header-bg-color: #9d9d9e;
    --footer-bg-color: #333;
    --topnav-link-hover-color: #7e7c7c;
    --active-link-bg-color: #04AA6D; /* Changed to match previous green */
    --dropbtn-bg-color: #04AA6D;
    --start-menu-bg: #f9f9f9;
    --start-menu-border: #ddd;
    --icon-color: #333;
    --settings-menu-bg: #fff;
    --settings-title-color: #555;
    --settings-icon-color: #0056b3;
    --switch-bg-color: #ccc;
    --switch-active-bg-color: #2196F3;
    
    /* Layout variables */
    --header-height: 50px;
    --footer-height: 50px;
    --top-bottom-padding: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =================================================================== */
/* --- Header Styling --- */
/* =================================================================== */
.header-section {
    background-color: var(--header-bg-color);
    color: white;
    width: 100%;
    height: var(--header-height);
}

.topnav {
    overflow: hidden;
    padding: 10px;
    height: 100%;
    display: flex;
    align-items: center;
}

.topnav a {
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
}

.topnav a:hover {
    background-color: var(--topnav-link-hover-color);
    color: black;
}

.topnav a.active {
    background-color: var(--active-link-bg-color);
    color: white;
}

/* =================================================================== */
/* --- Main Content and Settings Menu Styling --- */
/* =================================================================== */
.main-section {
    flex-grow: 1;
    padding: var(--top-bottom-padding);
}

.main-display {
    position: relative;
    height: 100%;
    width: 100%;
}

/* Settings Menu */
.settings-menu {
    display: none;
    position: fixed;
    right: 0;
    top: var(--header-height);
    width: 350px;
    padding: 15px;
    bottom: var(--footer-height);
    background-color: var(--dark-color);
    color: var(--main-color);
    border: 1px solid var(--border-color);
    box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px 0 0 8px; /* Rounded corners on the left side only */
    z-index: 10;
    max-height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow-y: auto;
}

.settings-menu.show {
    display: block !important;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group span{
    padding-left: 20px;
}

.settings-title {
    font-weight: bold;
    color: var(--main-color);
    font-size: 16px;
    display: block;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.settings-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
}

.settings-option i {
    font-size: 18px;
    margin-right: 10px;
    color: var(--settings-icon-color);
}

.settings-option span {
    flex-grow: 1;
}

/* Toggle Switch Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--switch-bg-color);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--switch-active-bg-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--switch-active-bg-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

/* =================================================================== */
/* --- Footer Styling --- */
/* =================================================================== */
.footer-section {
    background-color: var(--footer-bg-color);
    color: white;
    width: 100%;
    height: var(--footer-height);
}

.navbar {
    background-color: #555;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    box-sizing: border-box;
    height: 100%;
}

/* Start Menu Button and Dropup */
.navbar .dropup {
    position: relative;
    display: inline-block;
    height: 100%;
}

.navbar .dropbtn {
    background-color: var(--dropbtn-bg-color);
    color: white;
    padding: 14px 16px;
    font-size: 16px;
    border: none;

    cursor: pointer;
    height: 100%;
}

/* Right-side Icons and Clock */
.navbar-right {
    display: flex;
    align-items: center;
    color: white;
    height: 100%;
}

.navbar-right a {
    color: white;
    text-decoration: none;
    padding: 10px;
    display: flex;
    align-items: center;
    height: 100%;
}

#datetime {
    text-align: center;
    padding: 0 10px;
    font-size: 14px;
    cursor: pointer;
}

.time {
    font-weight: bold;
}

.date {
    font-size: 12px;
}

/* Dropup Menu and App Icons Styling */
.app-container {
    display: none;
    position: absolute;
    bottom: var(--footer-height);
    background-color: var(--start-menu-bg);
    min-width: 300px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    padding: 15px;
    border-radius: 5px;
    left: 0;
}

.app-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--start-menu-border);
}

.app-icons-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px 5px;
    border-radius: 5px;
    color: var(--icon-color);
    text-decoration: none;
    font-size: 14px;
}

.app-icons-grid a i {
    font-size: 32px;
    margin-bottom: 8px;
}

.app-icons-grid a:hover {
    background-color: #e9e9e9;
}

.user-icons-list {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
}

.user-icons-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    text-align: center;
    border-radius: 50%;
    color: var(--icon-color);
}

.user-icons-list a:hover {
    background-color: #e9e9e9;
}

.user-icons-list .power-off-icon {
    margin-left: auto;
}

/* =================================================================== */
/* Show/Hide Classes and Icon Sizing */
/* =================================================================== */

.show {
    display: block !important;
}

.fa, .fa-solid {
    font-size: 20px;
    width: 20px;
    text-align: center;
}

.material-icons {
    font-size: 20px;
    width: 20px;
    text-align: center;
}