@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

/* General Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  /* General Styling */
  body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem;
    height: 100vh;
    transition: background-image 0.5s ease;
  }
  
  header.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--title-bar-bg);
    color: var(--title-bar-text);
    padding: 1rem;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-origin: center;
    z-index: 100;
    backdrop-filter: blur(10px);
  }
  
  header.title-bar h1 {
    font-size: 1.25rem;
  }
  
  header.title-bar .date-display {
    font-size: 0.875rem;
  }
  
  main#app {
    width: 100%;
    max-width: 500px;
    margin-top: 1rem;
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
  }
  
  .today-header {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ff4757;
    display: none;
  }
  

  /* Task List */
  .task-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
  }
  
  .task-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1rem;
    border: 1px solid #ffffff47;
    border-radius: 8px;
    background-color: var(--card-bg);
    transition: all 0.3s;
    cursor: move;
    user-select: none;
    position: relative;
    transition: transform 0.2s;
  }
  
  .task-item.dragging {
    opacity: 0.5;
    background-color: var(--hover-bg);
    transform: scale(1.02);
    z-index: 1000;
  }
  
  .task-item.drag-over {
    border-top: 2px solid var(--primary-color);
  }
  
  .task-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    width: 100%;
    position: relative;
    gap: 0.5rem;
  }
  
  .task-header:hover {
    background-color: var(--hover-bg);
    border-radius: 10px;
  }
  
  .task-header::after {
    content: '⋮';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  
  .task-header:hover::after {
    opacity: 0.5;
  }
  
  .task-header:hover::after:hover {
    opacity: 0.8;
  }
  
  .task-content.expanded + .task-header::after {
    content: '−';
    font-size: 1.5rem;
  }
  
  .task-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--bg-color);
    border-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .task-content.expanded {
    max-height: 200px;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    border-radius: 10px;
  }
  
  .task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .task-actions-right {
    display: flex;
    gap: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
  }
  
  .task-item:hover .task-actions-right {
    opacity: 1;
  }
  
  .task-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
  }
  
  .task-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: auto;
  }
  
  .task-label span {
    font-size: 1rem;
    color: var(--text-color);
  }
  
  .task-label span.completed {
    text-decoration: line-through;
    color: var(--completed-text);
  }
  
  /* Add Task Section */
  .add-task {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  .add-task .task-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
  }
  
  .add-task .task-input:focus {
    border-color: #ff4757;
  }

  .add-task .task-input:hover {
    outline: 4px solid #ffac4742;
  }
  
  /* Progress Bar */
  .progress-bar-container {

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  progress#progressBar {
    width: 100%;
    height: 1rem;
    appearance: none;
    border-radius: 8px;
    overflow: hidden;
  }
  
  progress#progressBar::-webkit-progress-bar {
    background-color: #f0f0f0;
    border-radius: 8px;
  }
  
  progress#progressBar::-webkit-progress-value {
    background-color: #ff4757;
    border-radius: 8px;
  }
  
  #progressText {
    font-size: 0.875rem;
    color: #666;
  }
  
  .footer {
    font-size: 0.75rem; 
    padding: 1rem;
    color: #666;
  }
.footer-right {
  text-align: right;
  max-width: 200px;
}
  
  .delete-task {
    background: none;
    border: none;
    color: #ff4757;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    opacity: 0.6;
    transition: opacity 0.3s;
  }
  
  .delete-task:hover {
    opacity: 1;
  }
  
  .task-item .delete-task {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
  }
  
  /* Theme Variables */
  :root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --primary-color: #ff4757;
    --hover-bg: #efefef;
    --title-bar-bg: #ff4757;
    --title-bar-text: #ffffff;
    --completed-text: #888;
    --title-bar-bg-hover: #ff5c6c;
    --tooltip-bg: rgba(0, 0, 0, 0.7);
    --tooltip-text: #fff;
  }
  
  [data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #ffffff;
    --border-color: #404040;
    --primary-color: #ff6b6b;
    --hover-bg: #363636;
    --title-bar-bg: #ff6b6b;
    --title-bar-text: #ffffff;
    --completed-text: #666;
    --title-bar-bg-hover: #ff7c7c;
    --tooltip-bg: rgba(255, 255, 255, 0.7);
    --tooltip-text: #000;
  }
  
  /* Update existing body styles */
  body {
    background-color: var(--bg-color);
    color: var(--text-color);
  }
  
  /* Logo styles */
  .logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
  }
  
  /* Modal styles */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }
  
  .modal-content {
    background-color: var(--card-bg);
    margin: 10% auto 0 auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
  }
  
  .modal-header h3 {
    font-size: 1.5rem;
    font-weight: 500;
  }
  
  .close-modal {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.2s;
  }
  
  .close-modal:hover {
    opacity: 1;
  }
  
  .modal-body {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
  }
  
  .modal-body li {
    margin: 0.5rem 0;
  }
  
  /* Task menu styles */
  .task-menu {
    position: absolute;
    right: 0.75rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    display: none;
  }
  
  .task-menu.active {
    display: block;
  }
  
  .task-notes {
    margin-top: 0.5rem;
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border-radius: 4px;
    color: var(--text-color);
    background-color: var(--bg-color);
    border-color: var(--bg-color);
    font-size: 0.9rem;
  }
  .task-notes:focus, .task-notes:active, .task-notes:hover {
    border: 1px solid var(--border-color);
    background-color: var(--hover-bg);
    color: var(--text-color);
  }
  

  /* Icon button styles */
  .icon-button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    opacity: 0.6;
  }
  
  #refreshBackground {
    transition: opacity 0.3s, transform 0.3s, display 0.3s;
  }
  
  .icon-button:hover {
    background-color: var(--hover-bg);
    opacity: 1;
    transform: translateY(-1px);
  }
  
  .icon-button:active {
    transform: translateY(0px);
  }
  
  /* Specific styles for different action buttons */
  .icon-button[data-tooltip="Delete task"] {
    color: var(--primary-color);
  }
  
  .icon-button[data-tooltip="Delete task"]:hover {
    background-color: rgba(255, 71, 87, 0.1); /* Slight red tint */
  }
  
  .icon-button[data-tooltip="Reset to 24h"]:hover,
  .icon-button[data-tooltip="Reset to 5min"]:hover {
    background-color: rgba(52, 152, 219, 0.1); /* Slight blue tint */
    color: #3498db;
  }
  
  /* Enhanced tooltip styles */
  [data-tooltip] {
    position: relative;
  }
  
  [data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 3px;
    background-color: var(--tooltip-bg);
    color: var(--tooltip-text);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
    margin-bottom: 8px;
    pointer-events: none;
    transition-delay: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  [data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.3s;
  }
  
  /* Task countdown */
  .task-countdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
  }
  
  .task-countdown i {
    width: 16px;
    height: 16px;
  }
  
  /* Footer layout */
  .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px;
  }
  
  .footer-left {
    display: flex;
    gap: 0.5rem;
  }
  
  /* Update task header with menu button */
  .task-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
  }
  
  .task-menu-button {
    opacity: 0;  /* Hide by default */
    transition: opacity 0.2s;
    margin-left: auto;
  }
  
  .task-item:hover .task-menu-button {
    opacity: 0.6;  /* Show on hover */
  }
  
  /* Tooltip styles */
  [data-tooltip] {
    position: relative;
  }
  
  /* Modal tab styles */
  .modal-tabs {
    display: flex;
    gap: 1rem;
  }
  
  .modal-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.6;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 1.2rem;
  }
  
  .modal-tab.active {
    opacity: 1;
    border-bottom-color: var(--primary-color);
  }
  
  .modal-tab:hover {
    opacity: 1;
  }
  
  .modal-tab-content {
    display: none;
  }
  
  .modal-tab-content.active {
    display: block;
  }
  
  .modal-tab-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
  }
  
  .modal-tab-content li {
    margin: 0.75rem 0;
    line-height: 1.5;
  }
  
  /* Update drag handle styles */
  .drag-handle {
    display: none;
  }
  
  .task-item:hover .drag-handle {
    opacity: 0.4;
  }
  
  .task-item:hover .drag-handle:hover {
    opacity: 0.8;
  }
  
  .dragging .drag-handle {
    opacity: 0.8;
  }
  
  /* Title Bar Menu Styles */
  .title-bar {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-origin: center;
    z-index: 1000;
  }
  
  .title-bar:hover {
    transform: scale(1.01);
    background-color: #e03c49; /* Slightly darker than the default color */
  }
  
  .title-bar h1,
  .title-bar .date-display,
  .title-bar .logo {
    transition: all 0.3s ease;
  }

  .title-bar:hover svg {
    outline: 1px solid #ffffff91;
    outline-offset: 6px;
  }
  
  .title-menu {
    position: absolute;
    top: calc(100% + 5px); /* Slight gap from title bar */
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border-radius: 0 0 8px 8px;
    padding: 0; /* Start with 0 padding */
    max-height: 0; /* Start collapsed */
    opacity: 0;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
  }
  
  .title-menu.expanded {
    padding: 1rem;
    max-height: 150px; 
    opacity: 1;
    transform: translateY(-10px);
    border-top: 2px solid #ab4141;
  }
  
  
  /* Toggle Switch Styles */
  .toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .title-menu.expanded .toggle-container {
    opacity: 1;
    transform: translateY(0);
  }
  
  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
  }
  
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
  }
  
  .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  .toggle-switch:hover .toggle-slider:before {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  input:checked + .toggle-slider {
    background-color: var(--primary-color);
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(24px);
  }
  
  .toggle-label {
    font-size: 0.875rem;
    color: var(--text-color);
  }
  
  /* Pomodoro Timer Styles */
  .pomodoro-container {
    width: 100%;
    max-width: 500px;
    margin: 0.75rem 0;
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 50; /* Lower than tooltips, higher than main app */
  }
  
  .pomodoro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .pomodoro-title {
    font-weight: 500;
    color: var(--primary-color);
  }
  
  .minimize-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 4px;
    padding: 0.25rem;
    opacity: 0.6;
    transition: all 0.2s ease;
  }
  
  .minimize-btn:hover {
    opacity: 1;
    background-color: var(--hover-bg);
  }
  
  /* Minimized Pomodoro Timer Styles */
  .minimized-pomodoro {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 999; /* Higher than most elements, lower than tooltips */
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
  }
  
  .mini-timer {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
  }
  
  .mini-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.2s ease;
  }
  
  .mini-btn:hover {
    opacity: 1;
    background-color: var(--hover-bg);
  }
  
  .pomodoro-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .timer-display {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
  }
  
  .timer-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  .pomodoro-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  .pomodoro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  .pomodoro-btn:active {
    transform: translateY(0);
  }
  
  .pomodoro-mode {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .mode-btn {
    flex: 1;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
  }
  
  .mode-btn:hover {
    background-color: var(--hover-bg);
  }
  
  .mode-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
  }
  
  /* Special handling for tooltips on fixed elements (like minimized pomodoro) */
  .minimized-pomodoro [data-tooltip]:before {
    bottom: 150%; /* Position even higher for fixed elements */
  }
  