@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Rajdhani:wght@300;400;500;600;700&display=swap');

@import url('theme-light.css');
@import url('theme-dark.css');
@import url('theme-hyprland.css');
@import url('theme-coffee.css');
@import url('chat.css');
@import url('mobile.css');

/* ==========================================================================
   Global & Body Styles
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    overflow-x: hidden;
    --header-height: 45px;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
}

.site-logo {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 110px;
    height: 30px;
    color: transparent !important;
    position: relative;
}
.site-logo > * { visibility: hidden; }
.site-logo::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #333;
    -webkit-mask: url('../svg/ch4ze.svg') no-repeat center; mask: url('../svg/ch4ze.svg') no-repeat center;
    -webkit-mask-size: contain; mask-size: contain;
}

.site-nav a {
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-left: 20px;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}
.site-nav a:hover {
    color: #000;
}

.nav-clock-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 20px;
}

.nav-clock {
    color: #666;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 110px;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

.nav-ip {
    color: #666;
    font-weight: 600;
    font-size: 14px;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

.nav-weather {
    color: #666;
    font-weight: 600;
    font-size: 14px;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

/* Header Chat Button */
.header-chat-btn {
    margin-left: 20px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.header-chat-btn:hover {
    color: #000;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 14px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #fff;
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ==========================================================================
   Dashboard Layout & Widgets
   ========================================================================== */
.dashboard-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* App Container & Sliding Views (Hyprland Style) */
.app-container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height)); /* Subtract header height */
    overflow: hidden;
}

.view-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: transparent;
}

.view-slide.active {
    transform: translateX(0);
}

.view-slide.left {
    transform: translateX(-100%);
}

.view-slide.right {
    transform: translateX(100%);
}

/* Hide scrollbar for dashboard view */
#dashboard-view {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#dashboard-view::-webkit-scrollbar {
    display: none;
}

/* Adjustments for Chat inside Slide */
/* On the dedicated chat page, center the widget and give it a max-width */
#chat-view .chat-widget-card {
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-splits {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.split-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 150px; /* Ensure empty columns can receive drops */
}

.widget-card {
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Wrapper for Drag & Drop */
.widget-wrapper {
    cursor: grab;
    will-change: transform;
}
.widget-wrapper:active {
    cursor: grabbing;
}
.widget-wrapper.dragging {
    opacity: 0.4;
    border: 2px dashed #ccc;
    border-radius: 8px;
}

/* Staggered animation delays */
.widget-wrapper:nth-child(1) { animation-delay: 0.1s; }
.widget-wrapper:nth-child(2) { animation-delay: 0.2s; }
.widget-wrapper:nth-child(3) { animation-delay: 0.3s; }

@keyframes hyprPop {
    0% { opacity: 0; transform: scale(0.92) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Animation class for JS triggering & other views */
.animate-pop {
    animation: hyprPop 0.5s cubic-bezier(0.05, 0.9, 0.1, 1.0) backwards;
}

.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.widget-card h3 {
    margin-top: 0;
    color: #565e66;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Weather Widget */
.weather-temp {
    font-size: 2.5rem;
    font-weight: bold;
    color: #444;
}
.weather-condition {
    color: #888;
    margin: 5px 0;
}
.weather-location {
    margin: 0;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 10px;
    padding-bottom: 10px;
}
.weather-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 10px;
    padding-bottom: 10px;
}
.events-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}

/* Weather Widget Additions */
.weather-display {
    display: flex;
    align-items: center;
    gap: 15px;
}
.weather-icon {
    width: 80px;
    height: 80px;
    background-color: #f0f2f5;
    border-radius: 50%;
}
.weather-info {
    flex-grow: 1;
}
.weather-error p {
    color: #c0392b;
    margin: 0;
    font-weight: 600;
}

/* Weather Settings */
.weather-settings-panel {
    margin-bottom: 15px;
    padding: 10px;
    background: #f7f9fa;
    border-radius: 4px;
}
.weather-form {
    display: flex;
    gap: 5px;
}
.w-input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: 'Rajdhani', sans-serif;
}
.w-input.w-country-code {
    flex: 0 0 60px;
    width: 60px;
}
.w-btn {
    padding: 5px 10px;
    background: #565e66;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}
.w-btn:hover {
    background: #3e444a;
}

/* Forecast Styles */
.weather-location-header {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #565e66;
}

.forecast-container {
    display: flex;
    justify-content: space-between;
    overflow-x: auto; /* Allow horizontal scrolling on small screens */
    padding-bottom: 5px; /* Add space for the scrollbar */
    gap: 5px;
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 60px; /* Ensure items don't get too squished */
    padding: 8px 5px;
    background-color: #f7f9fa;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.forecast-day {
    font-weight: 700;
    font-size: 0.9rem;
    color: #565e66;
    margin-bottom: 5px;
}

.forecast-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

.forecast-temp {
    font-weight: 600;
    color: #333;
    display: flex;
    gap: 6px;
}

.temp-max {
    color: #333;
}
.temp-min {
    color: #888;
    font-weight: 400;
}

/* Todo Widget Additions */
.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.todo-controls {
    display: flex;
    gap: 10px;
}

.todo-icon-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}
.todo-icon-btn:hover { color: #565e66; }

.todo-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}

.add-todo-btn {
    background: #565e66;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 22px;
    line-height: 26px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    text-align: center;
    padding: 0;
}

.add-todo-btn:hover {
    background: #3e444a;
    transform: scale(1.1);
}

.add-todo-form {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.add-todo-form input[type="text"] {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    background-color: #f7f9fa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.add-todo-form input[type="text"]:focus {
    outline: none;
    border-color: #565e66;
    box-shadow: 0 0 0 3px rgba(86, 94, 102, 0.15);
}

.add-todo-form button {
    padding: 8px 15px;
    background-color: #565e66;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.add-todo-form button:hover {
    background-color: #3e444a;
}

.todo-list {
    list-style: none;
    padding: 0;
    color: #555;
    margin: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 5px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.todo-item:last-child {
    border-bottom: none;
}

.todo-item:hover {
    background-color: #f7f9fa;
}

.todo-item:hover .delete-todo-btn {
    opacity: 1;
    transform: scale(1);
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #999;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #565e66;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.todo-item.completed .todo-checkbox {
    background-color: #565e66;
    border-color: #565e66;
}

.todo-checkbox svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    transition: stroke-dashoffset 0.3s ease-in-out;
}

.todo-item.completed .todo-checkbox svg {
    stroke-dashoffset: 0;
}

.todo-text {
    flex-grow: 1;
    word-break: break-word;
}

.delete-todo-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s;
}

.delete-todo-btn svg {
    width: 16px;
    height: 16px;
    fill: #c0392b; /* Red color for the bin */
    vertical-align: middle;
    transition: fill 0.2s;
}

.delete-todo-btn:hover svg {
    fill: #a93226;
}

.todo-item-empty {
    color: #888;
    padding: 20px 0;
    text-align: center;
    list-style: none;
}

.todoist-connect-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    gap: 15px;
}

.todoist-connect-btn {
    background-color: #e44332; /* Todoist Red */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.todoist-connect-btn:hover {
    background-color: #c3392b;
}

.todo-logout-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 5px;
    transition: color 0.2s;
}
.todo-logout-btn:hover { color: #e74c3c; }

.todo-project-header {
    font-weight: 700;
    color: #333;
    margin-top: 20px;
    margin-bottom: 5px;
    padding: 5px 5px 10px 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
}

.todo-list > .todo-project-header:first-of-type {
    margin-top: 0;
}

.todo-project-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Expanded Todo Widget Styles --- */

/* Fullscreen Wrapper Override */
.widget-wrapper.expanded-wrapper {
    position: fixed !important;
    top: var(--header-height) !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--header-height)) !important;
    z-index: 9999 !important;
    background: transparent;
    padding: 20px;
    box-sizing: border-box;
    transform: none !important;
    animation: none !important;
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Disable drag cursor when expanded */
.widget-wrapper.expanded-wrapper {
    cursor: default !important;
}

.widget-wrapper.expanded-wrapper .widget-card {
    width: 100%;
    height: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.todo-expanded-view {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

.todo-sidebar {
    width: 250px;
    border-right: 1px solid #eee;
    padding: 20px 10px;
    overflow-y: auto;
    background: rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.todo-sidebar-header {
    font-weight: bold;
    text-transform: uppercase;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 10px;
    padding-left: 10px;
}

.todo-project-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.todo-project-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    transition: background 0.2s;
}
.todo-project-item:hover { background: rgba(0,0,0,0.05); }
.todo-project-item.active { background: rgba(0,0,0,0.1); font-weight: bold; color: #333; }

.todo-content-pane {
    flex: 1;
    padding: 20px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.todo-content-header h2 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    border-bottom: none;
}

/* Notes Widget */
.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.notes-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}
.notes-textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    padding: 10px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    background-color: #f7f9fa;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.notes-textarea:focus {
    outline: none;
    border-color: #565e66;
    box-shadow: 0 0 0 3px rgba(86, 94, 102, 0.15);
}

.notes-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.notes-save-btn {
    padding: 6px 15px;
    background-color: #565e66;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.notes-save-btn:hover {
    background-color: #3e444a;
}

.notes-status {
    font-size: 0.8rem;
    font-style: italic;
    color: #888;
    transition: color 0.3s;
}

.notes-status.success { color: #27ae60; }
.notes-status.error { color: #c0392b; }

/* Progress Widget */
.stat-item {
    margin-bottom: 15px;
}
.stat-item:last-child {
    margin-bottom: 0;
}
.stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}
.stat-bar-bg {
    background: #eee;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}
.stat-bar-fill {
    background: #565e66;
    height: 100%;
    border-radius: 3px;
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */
.login-prompt {
    text-align: center;
    margin-top: 100px;
    color: #565e66;
}

.ascii-art {
    font-family: monospace;
    font-size: 4px;
    line-height: 4px;
    white-space: pre;
    background: linear-gradient(45deg, #f38ba8, #1793d1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
    font-weight: bold;
    display: block;
    width: fit-content;
    margin: 0 auto 20px auto;
}

.btn-login {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background-color: #565e66;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-login:hover {
    background-color: #3e444a;
}

.login-sub-headline {
    text-align: center;
}

.login-form-container {
    width: 95%;
    max-width: 500px;
    margin: 40px auto;
    box-sizing: border-box;
}

.login-error {
    color: #ff5e57;
    font-weight: bold;
    margin-bottom: 15px;
}

.login-form-container input[type="text"],
.login-form-container input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    box-sizing: border-box;
    background-color: #f7f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form-container input[type="text"]:focus,
.login-form-container input[type="password"]:focus {
    outline: none;
    border-color: #565e66;
    box-shadow: 0 0 0 3px rgba(86, 94, 102, 0.15);
}

.login-form-container .btn-login {
    width: 100%;
    border: none;
    cursor: pointer;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.login-footer a {
    color: #565e66;
    font-size: 0.8rem;
    text-decoration: none;
}

/* ==========================================================================
   Links Widget
   ========================================================================== */
.links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.links-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}

.links-controls {
    display: flex;
    gap: 5px;
}

.links-control-btn {
    background: #f0f2f5;
    color: #565e66;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.links-control-btn:hover {
    background: #e1e4e8;
    color: #333;
}

#links-widget.delete-mode #links-delete-btn {
    background-color: #c0392b;
    color: white;
    border-color: #c0392b;
}

.links-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.link-btn {
    flex: 1 0 45%; /* Fallback for older browsers */
    text-align: center;
    padding: 10px 15px;
    background-color: #f7f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    color: #565e66;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.link-btn:hover {
    background-color: #565e66;
    color: #fff;
    border-color: #565e66;
}

.link-delete-icon {
    display: none;
    position: absolute;
    top: -2px;
    right: 3px;
    font-size: 1.4rem;
    font-weight: bold;
    color: #c0392b;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
}

.link-delete-icon:hover {
    transform: scale(1.2);
}

#links-widget.delete-mode .link-btn {
    cursor: default;
}

#links-widget.delete-mode .link-delete-icon {
    display: block;
}

.add-link-panel {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e4e8;
    animation: slideDown 0.2s ease-out;
}

.add-link-form {
    display: flex;
    gap: 10px;
}

.add-link-form input {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    background-color: #f7f9fa;
    min-width: 0;
}

.add-link-form button {
    padding: 8px 15px;
    background-color: #565e66;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.links-empty-state {
    grid-column: 1 / -1; /* Span both columns */
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* Timezone Menu */
.timezone-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 5px;
    min-width: 200px;
}

.timezone-menu select {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Rajdhani', sans-serif;
}

/* ==========================================================================
   Search Widget
   ========================================================================== */
.search-group {
    display: flex;
    gap: 10px;
}

.search-group input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    background-color: #f7f9fa;
}

.search-group button {
    background-color: #565e66;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-group button:hover {
    background-color: #3e444a;
}

/* ==========================================================================
   Public IP Widget
   ========================================================================== */
.ip-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #565e66;
    text-align: center;
    padding: 10px 0;
    letter-spacing: 1px;
}

/* Theme Select Dropdown */
.theme-select {
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: #565e66;
    cursor: pointer;
    margin-left: 15px;
    outline: none;
    transition: all 0.2s;
}
.theme-select:hover {
    border-color: #565e66;
}

/* ==========================================================================
   Calendar Widget
   ========================================================================== */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header h3 {
    margin-top: 0;
    margin-bottom: 15px;
    margin-bottom: 0;
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
}

.cal-nav-btn {
    background: none;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 8px;
    font-weight: bold;
    color: #565e66;
    transition: background-color 0.2s;
}

.cal-nav-btn:hover {
    background-color: #f0f2f5;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 0.9rem;
}

.cal-header {
    text-align: center;
    font-weight: 700;
    color: #888;
    padding-bottom: 5px;
    font-size: 0.8rem;
}

.cal-day {
    aspect-ratio: 1;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
}

.cal-day:hover {
    border-color: #565e66;
    z-index: 2;
}

.cal-day.weekend {
    background-color: #f0f2f5;
    color: #666;
}

.cal-day.holiday {
    background-color: #ffebee; /* Light red for holidays */
    border-color: #ffcdd2;
    color: #c62828;
    font-weight: bold;
}

.cal-day.today {
    border: 2px solid #565e66;
    font-weight: bold;
}

.cal-day.has-note {
    background-color: #e3f2fd; /* Light blue if it has a note */
}
.cal-day.has-note.holiday {
    background-color: #ffe0e0; /* Mix red/blue hint */
}

.note-indicator {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    background-color: #565e66;
    border-radius: 50%;
}

.cal-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: left;
}

.cal-day:hover .cal-tooltip {
    display: block;
}

/* Calendar Details Panel (Inline) */
.cal-details-panel {
    margin-top: 15px;
    border-top: 1px solid #e1e4e8;
    padding-top: 15px;
    display: none;
    flex-direction: column;
    animation: slideDown 0.2s ease-out;
}

.cal-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
    color: #565e66;
    font-size: 0.9rem;
}

.cal-details-close {
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: #888;
}
.cal-details-close:hover { color: #333; }

.cal-event-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 150px;
    overflow-y: auto;
}

.cal-event-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #333;
}
.cal-event-item:last-child { border-bottom: none; }

.cal-event-delete {
    color: #c0392b;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px;
    line-height: 1;
    opacity: 0.6;
}
.cal-event-delete:hover { opacity: 1; }

.cal-add-event {
    display: flex;
    gap: 5px;
}

.cal-add-event input[type="text"] {
    flex: 1;
    padding: 6px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Rajdhani', sans-serif;
    min-width: 0;
}

.cal-add-event button {
    background-color: #565e66;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 12px;
    cursor: pointer;
    font-weight: bold;
}

.cal-birthday-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    cursor: pointer;
    background: #f0f2f5;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    transition: background 0.2s;
}
.cal-birthday-label:hover { background: #e1e4e8; }
.cal-birthday-label input { margin: 0; cursor: pointer; }

/* ==========================================================================
   Calculator Widget
   ========================================================================== */
.calc-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-display {
    background-color: #f7f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    padding: 10px 15px;
    text-align: right;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Rajdhani', monospace;
    color: #333;
    margin-bottom: 5px;
    overflow-x: auto;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-btn {
    padding: 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    color: #565e66;
}

.calc-btn:hover { background-color: #f0f2f5; transform: translateY(-1px); }
.calc-btn:active { transform: translateY(1px); }

.calc-btn.op-btn { background-color: #f7f9fa; color: #333; }
.calc-btn.action-btn { background-color: #565e66; color: #fff; border-color: #565e66; grid-row: span 2; }
.calc-btn.action-btn:hover { background-color: #3e444a; }
.calc-btn.zero-btn { grid-column: span 2; }


/* ==========================================================================
   Monitor Widget Styles
   ========================================================================== */
.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 15px;
    padding-bottom: 10px;
}
.monitor-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
}
.monitor-live {
    color: #2ecc71;
    font-weight: bold;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.monitor-icon-fixed {
    width: 20px;
    text-align: center;
    margin-right: 5px;
    color: #565e66;
}
.monitor-footer {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

/* ==========================================================================
   Responsive Header (Icon Only Mode)
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1250px) {
    .nav-clock, .nav-ip, .nav-weather, .header-chat-btn, .site-nav a {
        font-size: 0;
        max-width: 44px; /* Shrink to icon size */
        padding: 0;
        gap: 0;
        justify-content: center;
    }

    .nav-clock i, .nav-ip i, .nav-weather i, .header-chat-btn i, .site-nav a i,
    .nav-clock svg, .nav-ip svg, .nav-weather svg, .header-chat-btn svg, .site-nav a svg {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .notification-badge {
        font-size: 0.75rem;
    }

    /* Hover Expansion Effect */
    .nav-clock:hover, .nav-ip:hover, .nav-weather:hover, .header-chat-btn:hover, .site-nav a:hover {
        font-size: 14px;
        max-width: 200px; /* Expand back to full width */
        padding: 0 20px;
        gap: 8px;
        background-color: rgba(0,0,0,0.04); /* Subtle highlight for light theme */
    }
}

/* ==========================================================================
   Headquarter View Styles
   ========================================================================== */
.headquarter-layout {
    display: flex;
    flex-direction: row; /* Default: Widgets Left, Terminal Right */
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.hq-widgets-pane {
    flex: 1 1 50%; /* Takes remaining space, shrinks if needed */
    height: 100%;
    overflow-y: auto;
    padding: 35px 10px 20px 20px;
    min-width: 300px; /* Ensure widgets don't disappear completely */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hq-widgets-pane::-webkit-scrollbar {
    display: none;
}

.hq-terminal-pane {
    flex: 0 0 50%; /* Fixed 50% width initially */
    height: 100%;
    min-width: 600px; /* Prevent shrinking too much before wrap */
    border-left: none;
    padding: 35px 20px 20px 10px;
}

/* Overrides when elements are moved into Headquarter */
.dashboard-container.in-headquarter {
    max-width: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.chat-container.in-headquarter .dashboard-container {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    max-width: none;
}

.chat-container.in-headquarter {
    height: 100%;
    width: 100%;
}

.chat-container.in-headquarter .chat-widget-card {
    height: 100%;
}

/* Responsive Stacking */
@media (max-width: 1200px) {
    .headquarter-layout {
        flex-direction: column-reverse; /* Stacked: Terminal Top (2nd child), Widgets Bottom (1st child) */
        overflow-y: auto; /* Main container scrolls */
    }

    .hq-terminal-pane {
        flex: none;
        width: 100%;
        height: 1000px; /* Fixed height as requested */
        min-width: 0;
        border-left: none;
        border-bottom: 1px solid #e1e4e8;
        padding: 35px 20px 20px 20px;
    }

    .hq-widgets-pane {
        flex: none;
        width: 100%;
        height: auto;
        overflow-y: visible;
        padding: 20px;
    }
}

/* ==========================================================================
   EXPANDED NOTES WIDGET STYLES (From notesexpand.html)
   Namespaced under #ne-app to prevent conflicts
   ========================================================================== */
#ne-app {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    color: #a2c1f4;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #1e293c;
    overflow: hidden;
    border-radius: 8px;
}

#ne-app .container { display: flex; height: 100%; width: 100%; position: relative; }
#ne-app .sidebar { width: 220px; background-color: #26344c; padding: 10px; display: flex; flex-direction: column; border-right: 1px solid #364b6d; flex-shrink: 0; }
#ne-app .notebar { width: 220px; background-color: #26344c; padding: 10px; display: flex; flex-direction: column; border-right: 1px solid #364b6d; flex-shrink: 0; }
#ne-app .note-content { flex: 1; background-color: #26344c; padding: 10px; display: flex; flex-direction: column; min-width: 0; }
#ne-app .note-content-ic { display: flex; flex-direction: column; height: 100%; }

#ne-app input, #ne-app textarea {
    background-color: #2d3e5b; border: 1px solid #364b6d; color: #a2c1f4;
    padding: 6px 8px; border-radius: 5px; width: 100%; margin-bottom: 10px;
    font-family: inherit;
}
#ne-app button {
    background-color: #5854cd; color: #d9d5fa; border: 1px solid #726ee1;
    padding: 6px 12px; border-radius: 5px; cursor: pointer; transition: background 0.3s;
    font-family: inherit;
}
#ne-app button:hover { background-color: #645fe5; }

/* Lists */
#ne-app ul { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; }
#ne-app .category-item, #ne-app .note-item {
    padding: 8px; border-bottom: 1px solid #314362; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
}
#ne-app .category-item:hover, #ne-app .note-item:hover,
#ne-app .category-item.selected, #ne-app .note-item.selected { background-color: #304262; }
#ne-app .category-item span, #ne-app .note-item span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 15px; position: relative;
}
#ne-app .category-item span::before, #ne-app .note-item span::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 8px; height: 8px; border-radius: 50%; border: 2px solid #888;
}

/* Toolbar */
#ne-app .toolbar {
    background: #1f2a3d; padding: 5px; border-radius: 5px; margin-bottom: 10px;
    display: flex; flex-wrap: wrap; gap: 5px;
}
#ne-app .toolbar button {
    width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center;
    background-color: transparent; border: 1px solid transparent;
}
#ne-app .toolbar button:hover { background-color: #445d77; border-color: #567; }

/* Editor */
#ne-app #editor_div {
    flex: 1; background-color: #2d3e5b; border: 1px solid #364b6d; border-radius: 5px;
    padding: 15px; overflow-y: auto;
}
#ne-app .rich-text-editor { min-height: 100%; outline: none; }

/* Tasks */
#ne-app .task_list_container { margin-bottom: 10px; }
#ne-app .task_date_div {
    background-color: #2d3e5b; border: 1px solid #364b6d; padding: 8px;
    border-radius: 5px; display: flex; align-items: center; gap: 10px;
}
#ne-app .task_date_div span { cursor: pointer; width: 16px; height: 16px; border: 2px solid #a2c1f4; border-radius: 50%; display: inline-block; }
#ne-app .subtasks_list_container { margin-left: 20px; margin-top: 5px; border-left: 2px solid #364b6d; padding-left: 10px; }

/* Modals */
#ne-app .ne-modal {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 100;
    backdrop-filter: blur(2px);
}
#ne-app .ne-modal-content {
    background-color: #34496c; padding: 20px; border-radius: 5px; width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Colors */
#ne-app .colors { display: flex; gap: 5px; margin: 10px 0; justify-content: center; }
#ne-app .color-option { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
#ne-app .color-option.selected { border-color: #fff; }

/* Utilities */
#ne-app .hidden { display: none !important; }
#ne-app .flex-row { display: flex; gap: 5px; }
#ne-app .flex-grow { flex: 1; }

/* Specific Colors for Dots */
#ne-app #renkb1653d::before { border-color: #b1653d !important; }
#ne-app #renk9a900b::before { border-color: #9a900b !important; }
#ne-app #renk6c8f20::before { border-color: #6c8f20 !important; }
#ne-app #renk1490b5::before { border-color: #1490b5 !important; }
#ne-app #renk1b86f2::before { border-color: #1b86f2 !important; }
#ne-app #renk527cf8::before { border-color: #527cf8 !important; }
#ne-app #renk8772ff::before { border-color: #8772ff !important; }
#ne-app #renkb34e99::before { border-color: #b34e99 !important; }
#ne-app #renkbb4141::before { border-color: #bb4141 !important; }
