/* 1) RESET & BASE
   -------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    height: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll on small screens */
}

/* Main container for page content under the ribbon */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 70px 20px 20px; /* top padding to accommodate the fixed ribbon (50px) plus some space */
    min-height: 100vh;
}

/* 2) TOP RIBBON (FIXED NAVBAR)
   -------------------------------------------------- */
.maple-icon {
    width: 16px;  /* Adjust the size */
    height: auto;
    margin-left: 5px; /* Space between text and icon */
    vertical-align: middle;
}

.top-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #4CAF50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 9999;
}

/* Title in the ribbon */
.ribbon-title a {
    text-decoration: none;
    color: inherit;
    font-size: 18px;
    font-weight: bold;
}

.ribbon-title a:hover {
    opacity: 0.8; /* Slight fade on hover for a modern feel */
}

.username-display {
    font-size: 16px; /* Smaller than the ribbon-title */
    color: white;
    font-weight: bold;
}

/* Hamburger button in the ribbon */
.hamburger-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* 3) SLIDE-OUT SIDEBAR (DRAWER)
   -------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 50px; /* Start just below the ribbon */
    bottom: 0;
    right: -250px;   /* hidden by default */
    width: 250px;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar.open {
    right: 0;
}

/* Optional: sidebar header */
.sidebar-header {
    background-color: #f0f0f0;
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
}

/* Sidebar content area (scrollable if needed) */
.sidebar-content {
    padding: 20px;
    overflow-y: auto;
}

/* Sidebar footer for logout at bottom */
.sidebar-footer {
    border-top: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    text-decoration-color: #4CAF50;
}

/* Sidebar form controls */
.sidebar-content .sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section table,tr,td {
    border: none;
}
.sidebar-content label {
    display: block;
    margin: 5px 0;
    font-weight: bold;
}
.sidebar-content input[type="text"],
.sidebar-content select {
    display: block;
    width: 100%;
    padding: 8px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.sidebar-content button {
    margin-top: 5px;
    width: 100%;
    border: none;
    color: #fff;
    background-color: #4CAF50;
    padding: 10px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}
.sidebar-content button:hover {
    background-color: #45a049;
}

/* 4) TABS LAYOUT
   -------------------------------------------------- */
.tabs-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto; /* center horizontally */
    margin-top: 20px;
    
}

/* Tab header row */
.tab-header {
    display: flex;
    gap: 5px;
    border-bottom: 0px solid #ccc;
}

/* Single tab in the header */
.tab {
    position: relative;
    padding: 10px 35px 10px 20px;
    background: #ddd;
    border: 1px solid #ccc;
    border-bottom: none;
    cursor: pointer;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    transition: background 0.2s ease;
    white-space: nowrap;
    min-width: 60px;
}
.tab:hover {
    background-color: #ccc;
}
.tab.active {
    background: #fff;
    border-color: #ccc;
    border-bottom: 1px solid #fff;
}

/* Red 'X' for deleting a tab in top-right corner */
.delete-tab-box {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background-color: #f44336;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

/* The '...' dropdown for other tabs */
.tab-list {
    display: none;            /* hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    background: #ddd;         /* match the tab's gray background */
    border: 1px solid #aaa;
    padding: 5px;
    z-index: 9999;            /* appear above main content but below sidebar/ribbon */
    border-top: none;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2); /* Soft shadow for depth */
    min-width: 150px;
    
    /* Rounded corners */
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.tab-list a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: black;
    transition: background 0.2s;
}

.tab-list a:hover {
    background: #bbb; /* Light highlight on hover */
}

.tab-option {
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px; /* Slight rounding for individual items */
}

.tab-option:hover {
    background-color: #ccc;
}

.tab-header {
    position: relative;
    border: none;
}

#more-tabs {
    position: relative;
}

.hidden {
    display: none;
}

/* 5) TAB CONTENT
   -------------------------------------------------- */
.tab-content-container {
    border: 1px solid #ccc;
    border-top: none;
    background: #fff;
    padding: 20px;
    margin-top: 0;
    display: block !important;
    width: 100%;
    padding: 10px;
    visibility: visible !important;
}

.tab-container {
    position: relative; /* Ensure the dropdown positions relative to this */
}

.current-tab-header {
    background: #fff;
    position: relative;
    padding: 10px 35px 10px 20px;
    border: 1px solid #ccc;
    border-bottom: none;
    cursor: pointer;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    transition: background 0.2s ease;
    white-space: nowrap;
    min-width: 60px;
}

.tab-content {
    border-top: none;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    margin-top: 20px;
    width: 80%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
}

/* 5.1) RE-TAB DROPDOWN
   -------------------------------------------------- */
   
.arrow-button {
  background: none;
  color: #333;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  line-height: 30px;
  cursor: pointer;
}
.arrow-button:hover {
  background-color: #e2e2e2;
}

/* The dropdown listing tabs */
.tab-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid #aaa;
  padding: 5px;
  z-index: 9999;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-right-radius: 8px;
  display: none; /* hidden by default */
  min-width: max-content; /* Ensures it expands to fit content */
  white-space: nowrap; /* Prevents text from wrapping */
  text-align: left; /* Ensures text aligns to the left */
}

.tab-dropdown.show {
  display: block;
}

.tab-dropdown .tab-option {
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
}
.tab-dropdown .tab-option:hover {
  background-color: #ccc;
}

/* 6) ITEM BUTTONS & SLIDER
   -------------------------------------------------- */
.back-button {
    background: none;
    color: #333;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    cursor: pointer;
}
.back-button:hover {
    background-color: #e2e2e2;
}

.delete-button {
    background: none;
    color: red;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    cursor: pointer;
}
.delete-button:hover {
    background-color: #fdd;
}

/* Range slider */
input[type=range] {
    width: 100px;
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    width: 100px;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.strike {
    text-decoration: line-through !important;
    color: gray !important;
    font-style: italic;
    opacity: 0.7;
}

/* 7) RESPONSIVE
   -------------------------------------------------- */
@media (max-width: 768px) {
    .tab-header {
        flex-wrap: wrap;
    }
    .tab-content {
        width: 95%;
    }
}

/* 8) LOGIN */
.white-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f4f4f4;
}

.login-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    width: 320px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 20px;
}

.login-box input[type="email"],
.login-box input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-box button, 
.btn {
    background: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.login-box button:hover, 
.btn:hover {
    background: #45a049;
}

.login-box p {
    margin-top: 10px;
}

.login-box a {
    color: #4CAF50;
    text-decoration: none;
}

.login-box a:hover {
    text-decoration: underline;
}

.remember-me {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.remember-me input {
    margin-right: 5px;
}

.auth-container {
    margin-top: 50px; /* Offsets the 50px-high ribbon */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 50px);
    background: #f4f4f9; 
}

.btn-register {
    margin-top: 30px;
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-register:hover {
    background-color: #45a049;
}

.forgot-password {
    float: right;
    text-decoration: none;
    color: #007BFF;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* 9) REGISTER */
.register-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    width: 320px;
    text-align: center;
}

.register-box h2 {
    margin-bottom: 20px;
}

.register-box input[type="text"],
.register-box input[type="email"],
.register-box input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.register-box button {
    background: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.register-box button:hover {
    background: #45a049;
}

.register-box p {
    margin-top: 10px;
}

.register-box a {
    color: #4CAF50;
    text-decoration: none;
}

.register-box a:hover {
    text-decoration: underline;
}

/* 10) SETTINGS */
.auth-container {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 50px);
    background: #f4f4f9;
}

.settings-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.settings-box h2 {
    margin-bottom: 20px;
}

.settings-box input[type="email"],
.settings-box input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.settings-box button, 
.btn {
    background: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.settings-box button:hover, 
.btn:hover {
    background: #45a049;
}

.settings-box p {
    margin-top: 10px;
}

.settings-box a {
    color: #4CAF50;
    text-decoration: none;
}

.settings-box a:hover {
    text-decoration: underline;
}

/* 11) DARK MODE
    ----------------------------------------- */

/* Base dark mode */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode .top-ribbon {
    background-color: #4CAF5 !important;
}

/* Override for main containers */
body.dark-mode .container,
body.dark-mode .sidebar,
body.dark-mode .auth-container {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

/* Links in dark mode */
body.dark-mode a {
  color: #90caf9;
}

/* Buttons in dark mode */
body.dark-mode button {
  border: 1px solid #444;
}

/* Specific overrides */
body.dark-mode .ribbon-title a {
  color: #e0e0e0 !important;
}

/* Input fields, selects, and textareas */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode select,
body.dark-mode textarea {
  background-color: #333 !important;
  color: #e0e0e0 !important;
  border: 1px solid #444 !important;
}

/* Boxes for login, register, settings */
body.dark-mode .login-box,
body.dark-mode .register-box,
body.dark-mode .settings-box {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  box-shadow: 0px 4px 6px rgba(0,0,0,0.4) !important;
}

/* Tables */
body.dark-mode table {
  border: 0px solid #444 !important;
}

/* Tab content containers */
body.dark-mode .tab-content,
body.dark-mode .tab-content-container {
  background-color: #1e1e1e !important;
}

/* Sidebar adjustments */
body.dark-mode .sidebar {
  background-color: #1e1e1e !important;
}
body.dark-mode .sidebar-header {
  background-color: #2e2e2e !important;
  border-bottom: 1px solid #444 !important;
}
body.dark-mode .sidebar-content {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

body.dark-mode .sidebar-footer a {
    background-color: #1e1e1e !important;
    color: #4CAF50;
}

/* Buttons in sidebar */
body.dark-mode .sidebar-content button {
  background-color: #4CAF5 !important;
   color: #e0e0e0 !important;
}

/* Delete and back buttons */
body.dark-mode .delete-button,
body.dark-mode .back-button {
  border: 1px solid #555 !important;
}

body.dark-mode .tab.active {
    background-color: #1e1e1e !important;
    border-bottom: none;
}

body.dark-mode .tab-dropdown, 
body.dark-mode .tab {
    background-color: #333 !important;
    border-bottom: none;
}

body.dark-mode .tab-list,
body.dark-mode .hidden {
    background-color: #333 !important;
}

body.dark-mode .hamburger-button {
    border: none;
}

/* Toggle switch remains the same */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin: 0 10px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #2196F3;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

