body {
    background: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 60px;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1200px;
    margin-top: 60px;
    margin: 100px auto; 
    gap: 40px; 
}

#container {
    width: 100%;
    padding-right: 40px;
    box-sizing: border-box;
    max-width: 500px;
    justify-self: end;
}

#timer-container {
    width: 100%;
    padding-left: 40px;
    box-sizing: border-box;
    border-left: 1px solid #333;
    max-width: 500px;
}

#new-item {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    font-family: inherit;
    font-size: 1.2em;
    padding: 10px 0;
    outline: none;
    margin-bottom: 15px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.checklist-item input {
    margin-right: 10px;
    cursor: pointer;
    transform: scale(1.3);
}

.checklist-item span {
    flex-grow: 1;
}

.checked {
    text-decoration: line-through;
    opacity: 0.7;
}

#checklist-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.timer-display {
    font-size: 3em;
    letter-spacing: 4px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 300;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
}

.time-inputs-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-input-group {
    position: relative;
    text-align: center;
}

.time-input-group input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    color: #fff;
    width: 60px;
    padding: 8px 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.4em;
    transition: all 0.3s;
    min-width: 40px;
}

.time-input-group input:focus {
    border-bottom-color: #666;
    outline: none;
}

.time-input-group label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #666;
    letter-spacing: 1px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    justify-content: center;
}

button {
    background: #333;
    border: none;
    color: #fff;
    padding: 10px 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    min-height: 40px;
}

button:hover {
    background: #444;
}

.time-separator {
    font-size: 2em;
    color: #333;
    margin: 0 5px;
    align-self: flex-end;
}

@keyframes alarmFlash {
    0% { background-color: #1a1a1a; }
    50% { background-color: #330000; }
    100% { background-color: #1a1a1a; }
}

.alarm-active {
    animation: alarmFlash 1s infinite;
}

#quote-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #666;
    font-size: 0.9em;
    width: 80%;
    max-width: 600px;
    font-style: italic;
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: transparent;
    border: 1px solid #666;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2em;
}

.light-mode {
    background: #fff !important;
    color: #333;
}

.light-mode #new-item,
.light-mode .time-input-group input,
.light-mode .timer-display {
    color: #333;
    border-bottom-color: #ccc;
}

.light-mode button:not(#theme-toggle) {
    background: #666;
    color: #fff;
}

.light-mode #theme-toggle {
    border-color: #333;
}

.light-mode .checked {
    opacity: 0.5;
}

.light-mode #timer-container {
    border-left-color: #ccc;
}

.light-mode #quote-container {
    color: #666;
}

#pomo-task, #pomo-break {
    background: #333;
    transition: background-color 0.3s ease;
}

#pomo-task:hover {
    background-color: #FFA50040;
}

#pomo-break {
    background: #333;
    transition: background-color 0.3s ease;
}

#pomo-break:hover {
    background-color: #90EE9040;
}

.light-mode #pomo-task {
    background-color: #666;
}

.light-mode #pomo-task:hover {
    background-color: #ce9d41;
}

.light-mode #pomo-break {
    background-color: #666;
}

.light-mode #pomo-break:hover {
    background-color: #4fba4fe6;
}

.light-mode #delete-checked:hover,
.light-mode #start-timer:hover,
.light-mode #reset-timer:hover {
    background: #555 !important;
    color: #fff !important;
}

.checklist-item span[contenteditable="true"] {
    outline: none;
    cursor: text;
    padding: 2px 5px;
    border-radius: 3px;
}

.checklist-item span[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.light-mode .checklist-item span[contenteditable="true"]:focus {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.delete-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 8px !important;
    margin-left: auto;
    opacity: 0.7;
    transition: all 0.2s;
    font-size: 0.9em;
    outline: none !important; 
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: transparent !important; 
    box-shadow: none !important; 
}

.light-mode .delete-btn:hover {
    background: transparent !important; 
}

.checklist-item {
    gap: 10px;
}

/* Bookmarks */
.bookmarks-grid {
    position: relative;  
    left: auto; 
    transform: none; 
    z-index: 100;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    max-width: 100%;
    margin: 10px auto;  
}

.bookmark-card {
    position: relative;
    background: #333;
    color: white;
    padding: 20px 15px;  
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    min-width: 120px;    
    max-width: 160px;    
    word-break: break-all;
    min-height: 50px;   
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    padding-top: 20px;   
}

.bookmark-card:hover {
    background: #444;
    transform: translateY(-2px);
}

.bookmark-card.add-new {
    background: #444;
    border: 2px dashed #666;
}

.bookmark-card.add-new:hover {
    background: #555;
    border-color: #777;
}

.bookmark-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 12px;
    opacity: 0.7;
}

.bookmark-delete:hover {
    opacity: 1;
    color: #ff4444;
}

.light-mode .bookmark-card {
    background: #666;
    color: #fff;
}

.light-mode .bookmark-card.add-new {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
}

.bookmark-controls {
    position: absolute;
    top: 2px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.bookmark-edit,
.bookmark-delete {
    position: static;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 10px;
    opacity: 0.7;
    margin: 0 2px; 
}

.bookmark-edit {
    margin-left: 4px; 
}

.bookmark-delete {
    margin-right: 4px;
}

.bookmark-edit:hover {
    opacity: 1;
    color: #4CAF50;
}

.light-mode .bookmark-edit {
    color: #333;
}

.light-mode .bookmark-edit:hover {
    color: #2E7D32;
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    #container {
        padding-right: 0;
        max-width: 100%;
        justify-self: center;
    }

    #timer-container {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #333;
        padding-top: 40px;
        max-width: 100%;
    }

    .timer-display {
        font-size: 2em;
    }

    .time-inputs-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .time-input-group input {
        width: 50px;
        font-size: 1.2em;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    button {
        width: 100%;
        max-width: 300px;
        padding: 12px 20px;
    }

    #new-item {
        font-size: 1em;
    }

    #quote-container {
        position: static;
        transform: none;
        margin-top: 40px;
        width: 100%;
        padding: 0 20px;
    }

    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 160px; /* Reduce top padding for bookmarks */
    }
    
    .bookmarks-grid {
        top: 80px;
        width: 95%;
    }
    
    .main-container {
        margin-top: 20px;
    }
    
    .bookmark-card {
        min-width: 80px;
        max-width: 100px;
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .light-mode #timer-container {
        border-top-color: #ccc;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-top: 110px;
    }

    .timer-display {
        font-size: 1.5em;
        letter-spacing: 2px;
    }

    .time-input-group input {
        width: 40px;
        font-size: 1em;
    }

    .time-separator {
        font-size: 1.5em;
    }

    #theme-toggle {
        top: 10px;
        right: 10px;
    }

    .bookmarks-grid {
        top: 70px;
        gap: 8px;
    }
    
    .bookmark-card {
        min-width: 70px;
        max-width: 80px;
        min-height: 40px;
        padding: 6px 8px;
        font-size: 0.7em;
    }
}

/* Quick Notes */
.notes-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px auto;
    max-width: 1200px; 
    padding: 0 20px;
    position: static; 
}
  
  .note-card {
    background: #333;
    color: white;
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 100px;
    max-width: 120px;
    word-break: break-word;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.8em;
    transition: all 0.3s;
    position: relative;
  }
  
  .note-card:hover {
    background: #444;
    transform: translateY(-2px);
  }
  
  .note-card.add-new {
    background: #444;
    border: 2px dashed #666;
  }
  
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
  }
  
  .modal-content {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    min-height: 300px;
    margin: auto;
    resize: both;
    overflow: auto;
    min-width: 300px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
  }
  
  
  #note-title {
    background: transparent;
    border: none;
    border-bottom: 1px solid #666;
    color: #fff;
    font-size: 1.2em;
    padding: 10px 0;
    font-family: 'Courier New', monospace;  
    outline: none;  
}

#note-body {
    background: transparent;
    border: 1px solid #666;
    color: #fff;
    flex: 1;
    padding: 10px;
    resize: none;
    outline: none;  
    font-family: 'Courier New', monospace; 
}
  
  .note-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
  }
  
  #save-note {
    background: #4CAF50;
    padding: 8px 20px;
  }
  
  #delete-note {
    background: #ff4444;
    padding: 8px 20px;
  }
  
  /* Light Mode */
  .light-mode .modal-content {
    background: #fff;
    border: 1px solid #ccc;
    }
  
  .light-mode .note-card {
    background: #666;  
    color: #fff;     
    }

    .light-mode .note-card:hover {
        background: #777;
    }

    .light-mode .note-card.add-new {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
    }

  .light-mode #note-title,
  .light-mode #note-body {
    color: #333;
    border-color: #ccc;
  }
  
  .light-mode #note-title {
    border-bottom-color: #ddd;
  }
  
  .light-mode #delete-note {
    background: #cc0000;
  }
  
  .light-mode #save-note {
    background: #2E7D32;
  }
  
  /* Mobile Optimization */
  @media (max-width: 768px) {
    .modal-content {
      width: 95%;
      min-width: unset;
      max-width: 95%;
      margin: 10px auto;
      resize: none;
    }
    
    #note-body {
      min-height: 200px;
    }
  }
  
  @media (max-width: 480px) {
    .modal-content {
      width: 95%;
      padding: 15px;
    }
    
    #note-body {
      min-height: 150px;
    }
  }

/* Tooltip container */
[data-tooltip] {
    position: relative;
}

/* Tooltip text */
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    padding: 6px 10px;
    background-color: #333;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

/* Special handling for theme toggle button */

#theme-toggle[data-tooltip]::before {
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    white-space: nowrap;
}

/* Show tooltip on hover */
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Light mode styles */
.light-mode [data-tooltip]::before {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile optimization */
@media (max-width: 768px) {
    [data-tooltip]::before {
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* Ensure tooltips stay within viewport */
[data-tooltip] {
    overflow: visible;
}

/* Handle tooltip positioning when near screen edges */
@media (max-width: 480px) {
    #theme-toggle[data-tooltip]::before {
        right: 0;
        white-space: normal;
        max-width: 150px;
        text-align: right;
    }
}

/* v5.0 Delete Buttons */

/* Control Buttons (Theme Toggle, Delete Notes, Delete Bookmarks) */
.control-button {
    position: fixed;
    right: 20px;
    background: transparent !important;
    border: none !important;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2em;
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.2s ease;
    outline: none;
}

.control-button:hover {
    transform: scale(1.1);
    background: transparent !important;
}

/* Remove specific styling for theme toggle */
#theme-toggle {
    top: 20px;
    border: none !important;
    border-radius: 0;
}

#delete-notes-btn {
    top: 70px;
}

#delete-bookmarks-btn {
    top: 120px;
}

/* Consistent tooltip positioning for all control buttons */
.control-button[data-tooltip]::before {
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    white-space: nowrap;
}

/* Light mode adjustments */
.light-mode .control-button {
    color: #333;
}

.light-mode #theme-toggle:hover,
.light-mode #delete-notes-btn:hover,
.light-mode #delete-bookmarks-btn:hover {
    background: transparent !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .control-button {
        right: 10px;
    }
    
    #theme-toggle {
        top: 10px;
    }
    
    #delete-notes-btn {
        top: 60px;
    }
    
    #delete-bookmarks-btn {
        top: 110px;
    }
    
    .control-button[data-tooltip]::before {
        right: calc(100% + 5px);
        font-size: 10px;
        padding: 4px 8px;
    }
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
}