/* I lowk gave up manually writing this last like 100 lines are mostly AI all before is AI cleanedup */


/* ---------------------------------------------------------------------------------------------- */
/* GLOBAL STYLES */
/* ---------------------------------------------------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen;
  background: url("Assets/LightBigSur1.jpg") center/cover;
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease, backdrop-filter 0.3s ease;
}

/* ---------------------------------------------------------------------------------------------- */
/* WINDOW SYSTEM */
/* ---------------------------------------------------------------------------------------------- */
.window {
  position: absolute;
  top: 190px;
  left: 240px;
  width: 900px;
  height: 600px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  resize: none;
  display: none;
  transition: background-color 0.3s ease, color 0.3s ease,
              top 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              left 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              width 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              height 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              border-radius 0.25s ease;
}

.window:not(.focused) .button {
  background: #ddd !important;
}

.titlebar {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  cursor: default;
  user-select: none;
  z-index: 10;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(10px);
  background: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.titlebar .buttons {
  display: flex;
  gap: 8px;
}

.title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.content {
  height: calc(100% - 28px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0;
  background: #fff;
}

.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  bottom: 0;
  right: 0;
  cursor: se-resize;
}

.window::-webkit-resizer,
.window::-moz-resizer,
.window::-ms-resizer {
  display: none !important;
}

.button {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.close { background: #ff5f57; }
.minimize { background: #ffbd2e; }
.maximize { background: #28c840; }

#iframe-frame {
  width: 100%;
  height: calc(100% - 10px);
  border: none;
}

/* Special Window Variants */
.iframe-window .titlebar {
  background: #1e1e1e;
  color: white;
}

.iframe-window .titlebar .title,
.settings-window .titlebar {
  color: white;
}

.settings-window .titlebar {
  background: none;
}

/* ---------------------------------------------------------------------------------------------- */
/* CALENDAR */
/* ---------------------------------------------------------------------------------------------- */
.calendar {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 10px;
  padding: 12px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cal-title { font-weight: 700; font-size: 28px; }

.cal-controls button {
  background: var(--glass);
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Inter", "Segoe UI";
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  margin-left: 6px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.8rem;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  height: 100%;
  box-sizing: border-box;
  flex: 1;
}

.day {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.day.inactive { opacity: 0.35; }

.day .date { font-weight: 600; margin-bottom: 6px; }

/* ---------------------------------------------------------------------------------------------- */
/* DOCK */
/* ---------------------------------------------------------------------------------------------- */
#dock {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translate(-50%, 0%);
  display: flex;
  padding: 0.3rem;
  border-radius: 1.2rem;
  z-index: 999;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 0.2px rgba(128,128,128,0.2),
              0 0 0 0.2px rgba(128,128,128,0.2),
              rgba(0,0,0,0.3) 2px 5px 19px 7px;
  transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease, backdrop-filter 0.3s ease;
}

#dock .dock-item {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

#dock .dock-item img {
  width: 52px;
  height: 52px;
  transition: transform 0.2s ease;
}

#dock .dock-item img:hover { transform: scale(1.2); }

#dock.hidden { transform: translate(-50%, 120%); }
#dock.shown { transform: translate(-50%, 0%); }

/* ---------------------------------------------------------------------------------------------- */
/* DATE DISPLAY */
/* ---------------------------------------------------------------------------------------------- */
#date-display {
  position: fixed;
  top: 8px;
  right: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: "Segoe UI", "Inter", sans-serif;
  background-color: rgba(255,255,255,0.4);
  padding: 4px 12px;
  border-radius: 36px;
  backdrop-filter: blur(10px);
  z-index: 31415926;
  box-shadow: inset 0 0 0 0.2px rgba(128,128,128,0.1),
              0 0 0 0.2px rgba(128,128,128,0.1),
              rgba(0,0,0,0.1) 2px 5px 19px 7px;
}







/* ==========================================
   GENERAL TRANSITIONS & WINDOW
   ========================================== */
body,
.titlebar,
.content,
#date-display,
.left-panel,
.right-panel {
  transition: background-color 0.3s ease, color 0.3s ease,
              backdrop-filter 0.3s ease;
}

.window {
  transition: background-color 0.3s ease, color 0.3s ease,
              top 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              left 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              width 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              height 0.35s cubic-bezier(0.25, 1.25, 0.5, 1),
              border-radius 0.25s ease;
}

/* ==========================================
   SETTINGS PANEL
   ========================================== */
.settings-container {
  display: flex;
  height: 100%;
}

/* LEFT PANEL */
.left-panel {
  width: 200px;
  background: rgba(240, 240, 240, 0.75);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}

.window-buttons {
  display: flex;
  gap: 8px;
  padding: 6px 12px 12px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
}

.settings-nav .nav-item {
  background: none;
  border: none;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  font-family: "Inter", "Segoe UI", sans-serif;
  cursor: pointer;
  color: #333;
  transition: background 0.2s;
  border-radius: 12px;
  margin: 2px 6px;
}

.settings-nav .nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.settings-nav .nav-item.active {
  background: rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

/* RIGHT PANEL */
.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.right-panel .titlebar {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0 12px;
  height: 38px;
  display: flex;
  align-items: center;
}

.settings-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

/* ==========================================
   NOTES PANEL
   ========================================== */
.notes-container {
  display: flex;
  height: 100%;
}

/* Header & Buttons */
.notes-header {
  padding: 6px 12px;
}

#new-note-btn {
  width: 100%;
  padding: 6px;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#new-note-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Notes List */
.notes-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.notes-list .note-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  text-align: left;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
}

.notes-list .note-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notes-list .note-item.active {
  background: rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

/* Note Item Inner Elements */
.note-item-title,
.note-item-content-wrapper {
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.note-item-title {
  display: block;
  padding: 2px 5px;
  white-space: nowrap;
}

.note-title-input-sidebar { width: 75%; box-sizing: border-box; background-color: transparent !important; border: none !important; border-radius: 4px; padding: 1px 4px; font-family: inherit; font-size: inherit; font-weight: 500; color: inherit; outline: none; }

.delete-note-btn {
  background: none;
  border: none;
  color: #a0a0a0;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.note-item:hover .delete-note-btn {
  visibility: visible;
  opacity: 1;
}

.delete-note-btn:hover {
  color: #f55;
}

/* Notes Editor */
.notes-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.notes-editor-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}

#notes-editor-area {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  padding: 12px;
  font-family: "Inter", sans-serif;
  background: transparent;
  color: inherit;
  overflow-y: auto;
}

#notes-editor-area:empty::before {
  content: 'Start typing...';
  color: #999;
  pointer-events: none;
  display: block;
}

#notes-textarea { display: none; }

/* Toolbar */
.notes-toolbar {
  padding: 4px 8px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.format-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: inherit;
  font-family: "Inter", sans-serif;
  transition: background-color 0.2s, border-color 0.2s;
}

.format-btn:hover {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.1);
}

.format-select {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 3px;
  color: inherit;
  font-family: inherit;
}

.format-select option {
  background-color: #fff;
  color: #000;
}

/* ==========================================
   THEME TOGGLE
   ========================================== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.theme-toggle input { display: none; }

.theme-toggle .slider {
  position: relative;
  width: 40px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  transition: background 0.3s;
}

.theme-toggle .slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.theme-toggle input:checked + .slider {
  background: #4cafef;
}

.theme-toggle input:checked + .slider::before {
  transform: translateX(20px);
}

/* ==========================================
   DARK MODE
   ========================================== */
body.dark {
  background: url("Assets/DarkBigSur1.jpg") center/cover;
  color: #f0f0f0;
}

body.dark .window {
  color: #f0f0f0;
}

body.dark .titlebar {
  background: #171717;
  color: white;
}

body.dark .content {
  background-color: #121212;
}

body.dark .left-panel {
  background: rgba(50, 50, 50, 0.75);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark #new-note-btn {
  color: #fff !important;
}

body.dark button {
  color: #fff;
}

body.dark .right-panel { background: #1e1e1e; }
body.dark #dock { background-color: rgba(30,30,30,0.8); }
body.dark #date-display { background-color: rgba(30,30,30,0.7); color: white; }

body.dark .settings-nav .nav-item {
  color: white;
}
body.dark .settings-nav .nav-item:hover { background: rgba(255,255,255,0.05); }
body.dark .settings-nav .nav-item.active { background: rgba(255,255,255,0.1); }

body.dark .notes-list .note-item:hover { background: rgba(255,255,255,0.05); }
body.dark .notes-list .note-item.active { background: rgba(255,255,255,0.1); }
body.dark .delete-note-btn { color: #777; }
body.dark .delete-note-btn:hover { color: #ff6b6b; }

body.dark .notes-toolbar { background: rgba(255,255,255,0.05); border-bottom-color: rgba(255,255,255,0.1); }
body.dark .format-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
body.dark .format-select { border-color: #555; background-color: #1e1e1e; }
body.dark .format-select option { background-color: #1e1e1e; color: #f0f0f0; }
body.dark #notes-editor-area:empty::before { color: #777; }

body.dark .note-title-input-sidebar { background-color: rgba(255,255,255,0.15); border-color: #555; }

body.dark .title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}


/* rah */

.iframe-window .content,
.iframe-window .content iframe {
  width: 100%;
  height: calc(100% - 18px);
}

/* calc */

.calculator-window {
  width: 250px; 
  min-width: 250px;
  height: 400px;
  min-height: 400px;
  flex-direction: column;
}

.calculator-window .content {
  display: flex;
  flex-direction: column;
  flex: 1;
  background-color: #333;
  overflow: hidden;
}

.calc-display {
  flex: 6;
  color: white;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 10px 10px;
  overflow: hidden;
}

.calc-result {
  font-size: 48px;
  font-weight: 300;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.bottom-row {
  flex: 4;
  display: flex;
  flex-direction: row; 
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.calc-buttons-scientific {
  flex: 1.2; 
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
}

.calc-buttons {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 10px;
}

.calc-button {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  background-color: #505050;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}


.calc-button:active {
  filter: brightness(1.2);
}

.calc-button.function {
  background-color: #d4d4d2;
  color: #525251;
}

.calc-button.operator {
  background-color: #ff9502;
  font-size: 24px;
}

.calc-button.zero {
  grid-column: span 2;
  border-radius: 34px;
  justify-content: flex-start;
  padding-left: 24px;
}

.calculator-window .titlebar {
  background: #333;
  color: white;
  padding: 0 12px;
  height: 38px;
  display: flex;
  align-items: center;
}

/* width plspslpsspls */

.calculator-window:not(.wide) .calc-buttons-scientific {
  display: none;
}

.calculator-window:not(.wide) .calc-buttons {
  flex: 1 1 100%;
}

/* experiments */

.browser-window .titlebar {
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, #e9e9e9, #e2e2e2);
  flex-shrink: 0;
}

.url-bar svg {
    width: 16px;
    height: 16px;
    color: #888;
}

.url-input {
    width: 100%;
    border: none;
    outline: none;
    background-color: transparent;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    text-align: center;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 12px;
}

.action-buttons svg {
    width: 20px;
    height: 20px;
    color: #555;
    cursor: pointer;
}

.tab {
    padding: 8px 12px;
    background-color: #d1d1d1;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    color: #444;
    border: 1px solid #c6c6c6;
    border-right: none;
    border-bottom: none;
    flex: 1;
    display: flex; 
    align-items: center;
    justify-content: center; 
}

body.dark .tab {
    padding: 8px 12px;
    background-color: #111111;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    color: #bbb;
    border: 1px solid #000;
    border-right: none;
    border-bottom: none;
    flex: 1;
    display: flex; 
    align-items: center;
    justify-content: center; 
}

body.dark .tab.active {
    background-color: #232323; 
    color: #fff;
    font-weight: 500;
}

.tab:last-child {
    border-right: 1px solid #c6c6c6;
}

.tab-title {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    margin-right: 8px; 
}

.close-tab {
    font-family: "Lucida Console", Monaco, monospace;
    font-size: 16px;
    padding: 0 4px;
    border-radius: 50%;
    line-height: 16px;
    height: 16px;
    flex-shrink: 0;
}

.close-tab:hover {
    background-color: #bbb;
}

.tab.active {
    background-color: #f9f9f9;
    color: #000;
    font-weight: 500;
}

.url-bar {
    flex: 1; 
    margin: 0 9%;
    background-color: #dcdcdc;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .url-bar {
    flex: 1; 
    margin: 0 9%;
    background-color: #232323;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .url-input {
  color: #fff !important;
}

.tab-bar {
    display: flex;
    padding: 0;
    background-color: #e2e2e2;
    flex-shrink: 0;
}

.close-tab:hover {
    background-color: #bbb;
}

.tab.active {
    background-color: #f9f9f9; 
    color: #000;
    font-weight: 500;
}

.content-view {
    flex-grow: 1;
    border: none;
    background-color: #ffffff; 
}


/* wallpaper switcher */

#wallpaper-switcher {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 columns */
  gap: 10px;
}

.wallpaper-thumb {
  width: 100%;
  aspect-ratio: 16/9; /* maintains 16:9 ratio */
  object-fit: cover;   /* cover ensures non-16:9 images aren’t stretched */
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.wallpaper-thumb:hover {
  border-color: #999;
}

.wallpaper-thumb.active {
  border-color: #4cafef;
}


/* Clock yippee */

.timer-window .titlebar {
  height: 50px;
}

.clock-tabs {
  display: flex;
  gap: 12px;
  margin: 0 auto;
}

.clock-tab {
  background-color: #eee;
  padding: 6px;
  border-radius: 8px;
}

.clock-tab.active {
  background-color: #ddd;
  padding: 6px;
  border-radius: 8px;
}

body.dark .clock-tab {
  background-color: #333;
}

body.dark .clock-tab.active {
  background-color: #555;
}

.time-display {
  font-size: 96px;
  text-align: center;
  margin-top: calc(10%);
}

.btn {
  width: 90px;
  height: 90px;
  cursor: pointer;
  border: none;
  border-radius: 60px;
  transition: background 0.3s;
  font-family: "Inter", "Segoe UI", sans-serif;
} 

.controls {
  display: flex;
  justify-content: center;
  gap: 449px;
}

.btn.primary { background: #007bff; color: #fff; }
.btn.secondary { background: #ccc; }
.btn:hover { background: #0056b3; color: #fff; }


#laps {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
}

#laps div {
  font-size: 1.2em;
  padding: 8px 16px;
  width: fit-content;
  text-align: center;
}

.btn-small {
  width: 60px;
  height: 60px;
  border-radius: 50px;
  font-size: 14px;
  font-family: "Inter", "Segoe UI", sans-serif;
  gap: 80px;
}
