@import url('fonts.css');

:root {
    --bg-image: none; 
    --bg-primary: #121415; 
    --bg-canvas: #151a17; 
    --accent-brass: #D4AF37;
    --accent-copper: #B87333;
    --accent-glow: rgba(255, 170, 0, 0.6); 
    
    --glass-bg: rgba(25, 28, 25, 0.85); 
    --glass-border: rgba(212, 175, 55, 0.2); 
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    
    --text-primary: #e0e0e0;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --primary-color: #B87333; 
    --primary-hover: #D4AF37; 
    --danger-color: #ef4444;
    --success-color: #10b981;
    
    --card-bg: rgba(30, 32, 30, 0.95); 
    --card-hover-bg: rgba(45, 48, 45, 0.98);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .card-title {
    font-family: 'Roboto Slab', serif;
}


.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}


header {
    padding: 1rem 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(18, 20, 21, 0.9) 0%, rgba(18, 20, 21, 0) 100%);
    pointer-events: none; 
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    pointer-events: auto;
}

h1 {
    position: relative;
    display: inline-block;
    padding: 0.45rem 1.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    
    color: var(--brass-main, #b3923b);
    
    background: linear-gradient(150deg, #3d362a 0%, #24211a 55%, #17140f 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 3px;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        inset 0 -2px 4px rgba(0, 0, 0, 0.7);
    
    transform: translateY(6px) rotate(-3deg);
    transform-origin: left bottom;
    
    text-shadow:
        -1px -1px 1px rgba(0, 0, 0, 0.85),
        1px 1px 1px rgba(255, 230, 180, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5);
}


h1::before,
h1::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffdca0 0%, #8a6a2c 60%, #3d2c0e 100%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.6);
}

h1::before {
    left: 6px;
}

h1::after {
    right: 6px;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 20px; 
    border: 1px solid var(--glass-border);
    background: rgba(10, 12, 10, 0.8);
    color: var(--accent-brass);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.search-bar input:focus {
    background: rgba(15, 18, 15, 0.95);
    border-color: var(--accent-copper);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 0 15px rgba(184, 115, 51, 0.4);
}

.header-actions {
    display: flex;
    gap: 1rem;
}


.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 4px; 
    border: 1px solid var(--glass-border);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.btn.primary {
    background: linear-gradient(145deg, var(--accent-copper), #8a5626);
    color: #111;
    border-color: #e69138;
}

.btn.primary:hover {
    background: linear-gradient(145deg, var(--accent-brass), #b3932e);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn.secondary {
    background: linear-gradient(145deg, #2a2d2a, #1a1c1a);
    color: var(--accent-brass);
}

.btn.secondary:hover {
    background: linear-gradient(145deg, #3a3d3a, #2a2c2a);
    border-color: var(--accent-brass);
    transform: translateY(-1px);
}

.btn.cancel {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn.cancel:hover {
    color: var(--danger-color);
}


::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 4px; border: 1px solid rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.6); }


.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: #fff;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.tag {
    background: rgba(184, 115, 51, 0.15);
    color: var(--accent-brass);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    font-size: 0.75rem;
    border: 1px solid rgba(184, 115, 51, 0.3);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: 8px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--accent-brass);
    box-shadow: 0 0 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(212, 175, 55, 0.05);
}

.glass-panel {
    background: #1a1c1a;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.01) 10px, rgba(255,255,255,0.01) 20px);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--accent-brass);
    text-align: center;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--accent-brass);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.required {
    color: var(--danger-color);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-family: 'Inter', sans-serif;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-brass);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 0 10px rgba(212, 175, 55, 0.2);
}

select option {
    background-color: #1a1c1a !important;
    color: #e0e0e0 !important;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}


.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 2000;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    background: rgba(18, 20, 21, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-left: 4px solid var(--accent-copper);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    color: white;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: 'Inter', sans-serif;
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }


.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1500;
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #2a2c2a 0%, #151815 100%);
    color: var(--accent-brass);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(212, 175, 55, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid var(--accent-copper);
}


.fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-main:hover {
    background: radial-gradient(circle at center, #3a3c3a 0%, #1a1e1a 100%);
    border-color: var(--accent-brass);
    transform: scale(1.05) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(212, 175, 55, 0.4);
}

.fab-menu {
    position: absolute;
    bottom: 75px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    
    background: rgba(30, 32, 30, 0.95);
    border: 1px solid var(--accent-copper);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-width: 180px;
}

.fab-container:hover .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-menu .btn {
    box-shadow: none;
    white-space: nowrap;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15); 
    border-radius: 0;
    color: var(--accent-brass);
    text-align: left;
    padding: 0.8rem 1.2rem;
}

.fab-menu .btn:last-child {
    border-bottom: none;
}

.fab-menu .btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.15);
}

.btn-tag-chip {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-brass);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 5px;
}

.btn-tag-chip:hover {
    background: rgba(212, 175, 55, 0.2);
}


.context-menu {
    border: 1px solid var(--accent-copper);
    background: rgba(30, 32, 30, 0.95);
    color: var(--accent-brass);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    
    justify-content: flex-start;
    gap: 8px;
}


.context-menu-arrow {
    margin-left: auto;
}

.context-menu-item:hover {
    background: rgba(212, 175, 55, 0.2);
}

.context-menu-separator {
    height: 1px;
    background: rgba(212, 175, 55, 0.2);
    margin: 4px 0;
}

.context-menu .has-submenu:hover > .context-submenu {
    display: flex !important;
}

.context-submenu {
    border: 1px solid var(--accent-copper);
    background: rgba(30, 32, 30, 0.98);
}


.card-type-task {
    background: linear-gradient(to bottom, rgba(30, 32, 30, 0.95) 0%, rgba(30, 32, 30, 0.95) 24px, rgba(212, 175, 55, 0.1) 25px);
    background-size: 100% 25px;
    border: 1px solid var(--accent-brass);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(212, 175, 55, 0.05);
    overflow: hidden; 
}

.card-type-task::after {
    content: '☑';
    position: absolute;
    bottom: -10px;
    right: 5px;
    font-size: 5rem;
    color: rgba(212, 175, 55, 0.05);
    pointer-events: none;
    z-index: 0;
}

.card-preview-task-wrapper {
    flex-grow: 1;
    width: 100%;
    margin-top: 5px;
    padding: 5px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    height: 100px; 
}


.card-preview-task-wrapper::-webkit-scrollbar {
    width: 4px;
}
.card-preview-task-wrapper::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.card-preview-task-content {
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Inter', sans-serif;
}


.image-preview-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 4px 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    z-index: 2000;
    transition: background 0.2s ease;
    border: none;
}

.image-preview-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.image-preview-target {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
    border: 1px solid var(--accent-brass);
}


.text-danger { color: #ff4d4d !important; }
.text-warning { color: #ff9999 !important; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.gap-10 { gap: 10px !important; }
.gap-8 { gap: 8px !important; }
.flex-1 { flex: 1 !important; }
.justify-between { justify-content: space-between !important; }
.pos-relative { position: relative !important; }


.header-search-clear {
    position: absolute;
    right: 5px;
    top: 5px;
    padding: 4px 8px;
}

.header-select {
    background: rgba(0, 0, 0, 0.5);
    color: var(--accent-brass);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    padding: 8px;
    font-family: 'Inter', sans-serif;
}

.binder-info-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    padding: 16px 20px;
    border-radius: 4px;
    pointer-events: auto;
    min-width: 250px;
    transition: all 0.3s ease;

    
    background-image:
        radial-gradient(circle, #ffdca0 0%, #8a6a2c 55%, #3d2c0e 100%),
        radial-gradient(circle, #ffdca0 0%, #8a6a2c 55%, #3d2c0e 100%),
        radial-gradient(circle, #ffdca0 0%, #8a6a2c 55%, #3d2c0e 100%),
        radial-gradient(circle, #ffdca0 0%, #8a6a2c 55%, #3d2c0e 100%),
        linear-gradient(150deg, #3d362a 0%, #24211a 55%, #17140f 100%);
    background-repeat: no-repeat;
    background-size: 6px 6px, 6px 6px, 6px 6px, 6px 6px, 100% 100%;
    background-position:
        8px 8px,
        calc(100% - 8px) 8px,
        8px calc(100% - 8px),
        calc(100% - 8px) calc(100% - 8px),
        0 0;

    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -2px 5px rgba(0, 0, 0, 0.7);
}

.binder-display-title {
    margin: 0 0 6px 0;
    font-size: 1.5rem;
    font-family: 'Roboto Slab', serif;
    letter-spacing: 1px;
    color: var(--brass-main, #b3923b);
    
    text-shadow:
        -1px -1px 1px rgba(0, 0, 0, 0.85),
        1px 1px 1px rgba(255, 230, 180, 0.25);
    cursor: pointer;
}

.binder-display-desc {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
    cursor: pointer;
    min-height: 1.5em;
    white-space: pre-wrap;
}

.form-select-dark {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px;
    width: 100%;
}

.tag-container {
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-results-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-empty-msg {
    color: #aaa;
    text-align: center;
    padding: 20px;
}


#binderLinkListContainer .binder-link-list-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: 10px;
    row-gap: 2px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

#binderLinkListContainer .binder-link-list-item:hover {
    background: rgba(212, 175, 55, 0.1);
}

#binderLinkListContainer .binder-link-cb {
    grid-row: 1 / 3;
    width: auto;
    height: auto;
    margin-top: 3px;
    padding: 0;
    background: none;
    box-shadow: none;
}

#binderLinkListContainer .binder-link-list-item-title {
    font-weight: 600;
    color: var(--accent-brass);
}

#binderLinkListContainer .binder-link-list-item-desc {
    font-size: 0.8rem;
    color: #999;
}


.search-modal-large {
    max-width: 1000px;
    width: 80%;
}

.search-tag-filter-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.chip-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    min-height: 44px;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.chip-input-container:focus-within {
    border-color: var(--accent-brass);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 0 10px rgba(212, 175, 55, 0.2);
}

.chip-input-field {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    color: white;
    font-family: 'Inter', sans-serif;
    padding: 4px;
}

.chip-input-field:focus {
    outline: none;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(184, 115, 51, 0.2);
    color: var(--accent-brass);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    padding: 3px 6px 3px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.tag-chip .tag-chip-remove {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.7rem;
}

.tag-chip .tag-chip-remove:hover {
    background: rgba(255, 100, 100, 0.4);
    color: white;
}

.tag-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
    background: #1a1c1a;
    border: 1px solid var(--accent-brass);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    list-style: none;
    margin: 0;
    padding: 4px;
}

.tag-suggestions-dropdown li {
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #e0e0e0;
}

.tag-suggestions-dropdown li:hover,
.tag-suggestions-dropdown li.active {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-brass);
}

.tag-match-toggle {
    display: flex;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.toggle-option {
    background: rgba(0, 0, 0, 0.5);
    color: #aaa;
    border: none;
    padding: 0 14px;
    height: 44px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.toggle-option.active {
    background: rgba(212, 175, 55, 0.25);
    color: var(--accent-brass);
}

.toggle-option:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-container {
    position: absolute;
    z-index: 10000;
    padding: 5px;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.context-submenu-container {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 120px;
    padding: 5px;
    border-radius: 8px;
}
