:root {
    /* 🌞 Catppuccin Latte (Light Mode) */
    --primary: #179299;
    --primary-hover: #157a7f;
    --background: #eff1f5;
    --container: #ffffff;
    --text: #4c4f69;
    --border: #ccd0da;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
  
    /* Accent Colors */
    --accent: #e64553;
    --accent-hover: #d20f39;
    --accent-transparent: rgba(230, 69, 83, 0.1);
    --overdue-yellow: rgba(249, 226, 175, 0.6);
    --overdue-orange: rgba(250, 179, 135, 0.55);
    --overdue-red: rgba(243, 139, 168, 0.5);
  
    /* ✅ New Highlight Color for Light Mode */
    --highlight-color: #f4d9e1; /* Catppuccin Latte Pink (Hex: #ea76cb, softened) */
  }
  
  [data-theme="dark"] {
    /* 🌙 Catppuccin Frappé (Dark Mode) */
    --primary: #179299;
    --primary-hover: #157a7f;
    --background: #303446;
    --container: #292c3c;
    --text: #c6d0f5;
    --border: #51576d;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  
    /* Accent Colors */
    --accent: #e64553;
    --accent-hover: #d20f39;
    --accent-transparent: rgba(230, 69, 83, 0.1);
    --overdue-yellow: rgba(249, 226, 175, 0.3);
    --overdue-orange: rgba(250, 179, 135, 0.3);
    --overdue-red: rgba(243, 139, 168, 0.3);
  
    /* ✅ New Highlight Color for Dark Mode */
    --highlight-color: #cba6f7; /* Catppuccin Frappé Mauve */
  }  


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
}

.app {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--text);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition);
}

button:hover {
    background: var(--primary-hover);
}

#themeToggle {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    font-size: 1.5rem;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text);
    border-radius: 50%;
}

#themeToggle:hover {
    background: rgba(255,255,255,0.1);
}

#themeToggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--text);
    fill: none;
    stroke-width: 2;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.clear-btn {
    background: transparent;
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
}

.clear-btn svg {
    stroke: var(--accent);
    stroke-width: 2;
    fill: none;
}

.clear-btn:hover {
    background: var(--accent-transparent);
}

.todo-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

input {
    flex: 1;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--container);
    color: var(--text);
    transition: border-color var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

@keyframes flash {
    0% {
      background-color: var(--highlight-color); /* mauve fallback */
    }
    100% {
      background-color: transparent;
    }
  }
  
  .todo-highlight {
    animation: flash 1.5s ease-out;
  }  
  

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.todo-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--container);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    width: 100%;
    max-width: 500px;
    cursor: default;
    position: relative;
}

.todo-item[draggable="true"] {
    cursor: grab;
  }
  

.todo-item.dragging {
    cursor: grabbing;
    opacity: 0.9;
    box-shadow: var(--shadow), 0 8px 16px rgba(0,0,0,0.1);
    transform: scale(1.02) translateY(-2px);
}

.todo-item[draggable="true"]:hover {
    transform: translateY(-2px);
}

.todo-item.completed span {
    text-decoration: line-through;
    opacity: 0.7;
}

.checkbox-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem;
}

.todo-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    justify-self: start;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.todo-item span {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    text-align: left;
    justify-self: start;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color var(--transition);
}

.todo-item span:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .todo-item span:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.todo-item .edit-input {
    width: 100%;
    padding: 0.25rem;
    margin: 0;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: var(--container);
    color: var(--text);
    font-size: inherit;
    font-family: inherit;
}

.todo-item a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity var(--transition);
}

.todo-item a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.todo-item.completed a {
    opacity: 0.7;
    text-decoration: line-through;
}

.delete-btn, .recurrence-btn {
    display: flex;  /* 🔥 Ensures the button itself is a flex container */
    align-items: center; /* 🔥 Centers the content vertically */
    justify-content: center; /* 🔥 Centers the content horizontally */
    width: 1.7rem;
    height: 1.7rem; /* 🔥 Explicitly set height to match width */
    margin-left: auto;
    background: transparent;
    color: var(--accent);
    padding: 0.25rem;
    border: 1px solid var(--accent);
    justify-self: end;
    pointer-events: auto;  /* Ensure clicks are registered */
}

.recurrence-btn svg,
.delete-btn svg {
    display: block !important; /* Ensures visibility */
    width: 1.2rem; /* Explicitly set width */
    height: 1.2rem; /* Explicitly set height */
    stroke: var(--accent) !important; /* Ensures color is visible */
    fill: none !important;
    stroke-width: 2;
    pointer-events: none;  /* Prevent SVG from blocking the button click */
}

.recurrence-btn {
    width: 1.7rem; /* 🔥 Matches `.delete-btn` width exactly */
}

.recurrence-btn svg {
    overflow: visible !important; /* Ensures no clipping */
    width: .8rem;
    height: .8rem;
    stroke-width: 2;
    fill: none;
    margin: auto; /* 🔥 Ensures perfect centering */
}

.delete-btn:hover, .recurrence-btn:hover {
    background: var(--accent-transparent);
}

.todo-actions {
    display: flex;
    flex-direction: row;  /* Ensures buttons are placed in a row */
    gap: 0.5rem;          /* Adds spacing between buttons */
    align-items: center;  /* Aligns buttons vertically in the middle */
}

.custom-recurrence {
    position: absolute;
    background: var(--container);
    border: 1px solid var(--accent) !important;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    font-size: inherit;
    overflow: hidden;
    min-width: 120px; /* Matches button width */
    max-width: 140px; /* Prevents menu from being too wide */
}

/* 🔥 Ensure it overrides .custom-select completely */
.custom-recurrence.recurrence-menu {
    background: var(--container) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow) !important;
}

/* 🔹 Recurrence menu items */
.custom-recurrence .recurrence-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--accent); /* Uses red accent */
    transition: background-color var(--transition);
    text-align: left;
    font-size: inherit;
    width: 100%;
}

/* 🔹 Ensure correct hover effect */
.custom-recurrence .recurrence-option:hover {
    background-color: var(--accent-transparent) !important;
}

/* Ensure rounded corners for first and last options */
.custom-recurrence .recurrence-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.custom-recurrence .recurrence-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}


.recurrence-label {
    color: var(--accent);
    margin-right: 8px; /* Ensures spacing from the buttons */
    font-weight: 300; /* Lighter than normal (400) */
}

.recurrence-label:hover {
    background-color: transparent !important;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--container);
    border-radius: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity var(--transition);
}

.toast.show {
    opacity: 1;
}

.todo-divider {
    width: 100%;
    max-width: 500px;
    text-align: left;
    padding: 1rem 0;
    margin: 1rem 0;
    color: var(--text);
    opacity: 0.7;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 480px) {
    .app {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .todo-form {
        flex-direction: column;
        align-items: center;
    }
    
    .button-group {
        width: 100%;
        max-width: 400px;
    }
    
    .button-group button[type="submit"] {
        flex: 1;
    }
}

/* PIN Modal Styles */

.pin-description {
    color: var(--text);
    opacity: 0.8;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.pin-input-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.pin-input-container input.pin-input {
    width: 35px;
    height: 45px;
    text-align: center;
    font-size: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--container);
    color: var(--text);
    transition: all var(--transition);
    flex: none;
    max-width: 30px;
    padding: 0;
}

.pin-input-container input.pin-input:focus {
    outline: none;
    border-color: var(--primary);
}

.pin-input-container input.pin-input.has-value {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

[data-theme="dark"] .pin-input-container input.pin-input.has-value {
    color: white;
}

[data-theme="light"] .pin-input-container input.pin-input.has-value {
    color: white;
}

.pin-error {
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 1rem;
    display: none;
}

.pin-error[aria-hidden="false"] {
    display: block;
}

/* Remove logo styles as they're no longer needed */

.list-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0 1rem;
}

.list-buttons {
    display: flex;
    gap: 0.25rem;
}

.icon-btn {
    background: transparent;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.icon-btn svg {
    stroke: var(--text);
    stroke-width: 2;
    fill: none;
}

.icon-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--primary);
}

.icon-btn:hover svg {
    stroke: var(--primary);
}

.list-selector-container {
    position: relative;
    min-width: 150px;
}

.list-selector-container::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text);
    pointer-events: none;
    z-index: 2;
}

#listSelector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--container);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    padding-right: 24px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    position: relative;
    z-index: 1;
    text-align: left;
}

#listSelector:focus {
    outline: none;
    border-color: var(--primary);
}

/* Hide native select dropdown in Firefox */
#listSelector:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 var(--text);
}

/* Hide native select dropdown in IE/Edge */
#listSelector::-ms-expand {
    display: none;
}

#listSelector option {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-select {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--container);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--text);
    transition: background-color var(--transition);
    text-align: left;
}

.list-item:hover {
    background: rgba(33, 150, 243, 0.1);
}

.list-item .delete-btn {
    opacity: 0;
    transition: opacity var(--transition);
    color: var(--accent);
    background: none;
    border: none;
    padding: 0.25rem;
    margin-left: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.list-item:hover .delete-btn {
    opacity: 1;
}

.list-item .delete-btn:hover {
    color: var(--accent-hover);
}

.list-item .delete-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.list-item.list-1 .delete-btn {
    display: none;
}

.task-outline-yellow {
    outline: 1px solid var(--overdue-yellow);
    border-radius: 8px;
}

.task-outline-orange {
    outline: 1px solid var(--overdue-orange);
    border-radius: 8px;
}

.task-outline-red {
    outline: 1px solid var(--overdue-red);
    border-radius: 8px;
}

.todo-item {
    transition: outline-color var(--transition);
}


@media (max-width: 600px) {
    .list-controls {
        position: static;
        margin-bottom: 1rem;
        justify-content: center;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    #themeToggle {
        position: static;
        margin-left: auto;
    }
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box {
    background: var(--container);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.login-page #themeToggle {
    position: absolute;
    top: 0;
    right: 0;
}

.login-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.login-page h2 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 1.5rem;
    }
    
    .login-page h1 {
        font-size: 2rem;
    }
}

/* PIN Status Styles */
.pin-status {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.attempts-remaining {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.attempts-remaining[aria-hidden="false"] {
    display: block;
}

.lockout-notice {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--accent-transparent);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    display: none;
}

.lockout-notice[aria-hidden="false"] {
    display: block;
}

.pin-error {
    color: var(--accent);
    font-size: 0.9rem;
    display: none;
}

.pin-error[aria-hidden="false"] {
    display: block;
}

.active-todos, .upcoming-todos, .completed-todos {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

/* Add a visual indicator for drop target */
.todo-item:not(.completed):not(.dragging)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

/* Add touch-friendly tap target on mobile */
@media (max-width: 768px) {
    .checkbox-wrapper {
        padding: 0.75rem;
        margin: -0.75rem;
    }
} 
