/* Float Add - Quick Task Input */

#float-add-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

#float-add-overlay.show {
    opacity: 1;
    visibility: visible;
}

#float-add-bar {
    width: 600px;
    max-width: 90%;
    background: var(--color-panel-bg, #fff);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--color-highlight, #eee);
}

#float-add-overlay.show #float-add-bar {
    transform: translateY(0);
}

/* Input Wrapper for Highlighting */
.float-input-wrapper {
    position: relative;
    width: 100%;
    font-size: 1.25rem;
    font-family: inherit;
}

/* Common typo styles to ensure perfect overlap */
.float-typo {
    width: 100%;
    padding: 0.5rem;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
    letter-spacing: normal;
    box-sizing: border-box;
    min-height: 3rem;
    /* Minimum height */
}

/* The transparent input */
#float-input {
    position: relative;
    background: transparent;
    color: transparent;
    caret-color: var(--color-primary-text, #111);
    z-index: 2;
    resize: none;
    /* Disable manual resize */
    overflow: hidden;
    /* Hide scrollbars for auto-expand */
}

#float-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* The backdrop highlights */
#float-highlights {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--color-primary-text, #111);
    pointer-events: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    z-index: 1;
    background: transparent;
}

/* Keyword Badges */
.smart-keyword {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}



.smart-tag {
    color: #a855f7; /* Purple-500 */
    background: rgba(168, 85, 247, 0.15);
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.smart-priority {
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.smart-p-high {
    color: #FF5F57;
    background: rgba(255, 95, 87, 0.15);
}

.smart-p-med {
    color: #FEBC2E;
    background: rgba(254, 188, 46, 0.15);
}

.smart-p-low {
    color: #28C840;
    background: rgba(40, 200, 64, 0.15);
}

/* Priority Menu Colors */
.priority-opt[data-value="high"] {
    background-color: rgba(255, 95, 87, 0.15);
}

.priority-opt[data-value="high"]:hover {
    background-color: rgba(255, 95, 87, 0.25);
}

.priority-opt[data-value="medium"] {
    background-color: rgba(254, 188, 46, 0.15);
}

.priority-opt[data-value="medium"]:hover {
    background-color: rgba(254, 188, 46, 0.25);
}

/* Remove text background inside priority buttons */
.priority-opt .smart-priority {
    background: transparent !important;
    padding: 0;
    /* Remove padding if any since button has padding */
}

.priority-opt[data-value="low"] {
    background-color: rgba(40, 200, 64, 0.15);
}

.priority-opt[data-value="low"]:hover {
    background-color: rgba(40, 200, 64, 0.25);
}

/* Placeholder styling only visible when empty */
#float-input::placeholder {
    color: var(--color-secondary-text, #888);
}

.float-hints {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0;
    font-size: 0.75rem;
    color: var(--color-secondary-text, #888);
    border-top: 1px solid var(--color-highlight, #eee);
    padding-top: 0.75rem;
}

.float-hint-key {
    background: var(--color-input-bg, #f4f4f5);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    border: 1px solid var(--color-highlight, #ddd);
}

.float-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.float-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 0.5rem;
    gap: 0.35rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--color-highlight, #eee);
    color: var(--color-secondary-text);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    font-weight: 500;
}

.float-icon-btn:hover {
    background: var(--color-input-bg);
    color: var(--color-primary-text);
}

.float-icon-btn.active {
    background: var(--color-highlight);
    color: var(--color-accent, #F97316);
    border-color: var(--color-highlight);
}

.float-icon-btn svg {
    width: 18px;
    height: 18px;
}

#float-add-btn {
    margin-left: auto;
    background: #888c91;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#float-add-btn:hover {
    opacity: 0.9;
}

/* Date Picker Popover */
.float-popover {
    position: absolute;
    /* Will be positioned by JS mostly, but set default */
    background: var(--color-panel-bg);
    border: 1px solid var(--color-highlight);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 280px;
    padding: 1rem;
    z-index: 10000;
    margin-top: 8px;
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.float-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Positioning relative to trigger */
.float-popover.hidden {
    display: none;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.picker-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary-text);
}

.picker-nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: var(--color-secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-nav-btn:hover {
    background: var(--color-input-bg);
    color: var(--color-primary-text);
}

.picker-nav-btn svg {
    width: 16px;
    height: 16px;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-secondary-text);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--color-primary-text);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.cal-day-btn:hover {
    background: var(--color-input-bg);
}

.cal-day-btn.today {
    color: #3b82f6;
    font-weight: 600;
}

.cal-day-btn.selected {
    background: #3b82f6;
    color: white;
}

.cal-day-btn.empty {
    pointer-events: none;
}

.picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-highlight);
}

.time-range-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 65%;
}

.time-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-input-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.time-label {
    font-size: 0.75rem;
    color: var(--color-secondary-text);
    font-weight: 500;
    min-width: 35px;
}

.time-field input {
    background: transparent;
    border: none;
    color: var(--color-primary-text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    width: 100%;
}


.picker-action-btn {
    background: transparent;
    border: none;
    font-size: 0.8rem;
    color: var(--color-secondary-text);
    cursor: pointer;
}

.picker-action-btn:hover {
    color: #ef4444;
    /* Red for clear */
}

/* Priority Menu */
#float-priority-menu {
    width: auto;
    min-width: 80px;
    padding: 0.35rem;
}

.priority-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.priority-opt {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.priority-opt:hover {
    background: var(--color-input-bg);
}

.priority-opt.active {
    background: var(--color-highlight);
}

.priority-opt span.smart-priority {
    padding: 0.1rem 0.4rem;
    /* Match badge look */
    font-size: 0.85rem;
    font-weight: 500;
}

/* Priority Colors */
.p-high {
    background-color: #FF5F57;
    box-shadow: 0 0 5px rgba(255, 95, 87, 0.4);
}

/* Tags Menu */
#float-tags-menu {
    width: 200px;
    padding: 0.5rem;
}

.tags-search-wrapper { 
    margin-bottom: 0.5rem; 
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-highlight);
}

#tags-search-input { 
    width: 100%; 
    padding: 0.35rem 0.5rem; 
    border: none; 
    border-radius: 6px; 
    background: var(--color-input-bg); 
    color: var(--color-primary-text); 
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

#tags-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    background: var(--color-panel-bg);
}

.tags-list { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
    max-height: 180px; 
    overflow-y: auto; 
    scrollbar-width: thin;
}

.tags-list::-webkit-scrollbar {
    width: 4px;
}
.tags-list::-webkit-scrollbar-track {
    background: transparent;
}
.tags-list::-webkit-scrollbar-thumb {
    background: var(--color-highlight);
    border-radius: 2px;
}

.tag-opt { 
    text-align: left; 
    padding: 0.35rem 0.5rem; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    border-radius: 4px; 
    color: var(--color-primary-text); 
    font-size: 0.85rem; 
    display: flex;
    align-items: center;
}

.tag-opt:hover { 
    background: var(--color-input-bg); 
}

.tag-opt.hidden {
    display: none;
}

.p-med {
    background-color: #FEBC2E;
    box-shadow: 0 0 5px rgba(254, 188, 46, 0.4);
}

.p-low {
    background-color: #28C840;
    box-shadow: 0 0 5px rgba(40, 200, 64, 0.4);
}

/* Tags Menu */
#float-tags-menu {
    width: 200px;
    padding: 0.5rem;
}

.tags-search-wrapper { 
    margin-bottom: 0.5rem; 
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-highlight);
}

#tags-search-input { 
    width: 100%; 
    padding: 0.35rem 0.5rem; 
    border: 1px solid var(--color-highlight); 
    border-radius: 6px; 
    background: var(--color-input-bg); 
    color: var(--color-primary-text); 
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

#tags-search-input:focus {
    background: var(--color-panel-bg);
}

.tags-list { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
    max-height: 180px; 
    overflow-y: auto; 
    scrollbar-width: thin;
}

.tags-list::-webkit-scrollbar {
    width: 4px;
}
.tags-list::-webkit-scrollbar-track {
    background: transparent;
}
.tags-list::-webkit-scrollbar-thumb {
    background: var(--color-highlight);
    border-radius: 2px;
}

.tag-opt { 
    text-align: left; 
    padding: 0.35rem 0.5rem; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    border-radius: 4px; 
    color: var(--color-primary-text); 
    font-size: 0.85rem; 
    display: flex;
    align-items: center;
}

.tag-opt:hover { 
    background: var(--color-input-bg); 
}

.tag-opt.hidden {
    display: none;
}

.p-none {
    background-color: var(--color-highlight);
    border: 1px solid var(--color-secondary-text);
    box-sizing: border-box;
}