.dashboard-icon {
    height: 2em;
    vertical-align: middle;
    margin-right: 0.2em;
}

:root {
    --bg-color: #000000;
    --card-bg: #000000;
    --text-color: #e0e0e0;
    --accent-color: #FBB1AD;
    /* Matches bot embed color */
    --secondary-text: #a0a0a0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
}

h1 {
    margin: 0;
    font-weight: 600;
    color: var(--accent-color);
}

.btn {
    background-color: #5865F2;
    /* Discord Blurple */
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #4752C4;
}

.btn-logout {
    background-color: #333;
}

.btn-logout:hover {
    background-color: #444;
}

.note-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #333;
    transition: transform 0.2s;
}

.note-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

.note-content {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.note-image {
    margin-top: 1rem;
    max-width: 100%;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    color: var(--secondary-text);
    margin-top: 4rem;
}

.loading {
    text-align: center;
    margin-top: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #333;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-text);
}

.form-group textarea,
.form-group input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #333;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-danger {
    background-color: #DA373C;
}

.btn-danger:hover {
    background-color: #A1282C;
}

/* Link Embed Styles */
.link-embed {
    display: flex;
    background-color: #2f3136;
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    gap: 10px;
    max-width: 500px;
}

.embed-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.embed-site {
    font-size: 0.75rem;
    color: var(--secondary-text);
    margin-bottom: 4px;
}

.embed-title {
    font-weight: 600;
    color: #00b0f4;
    text-decoration: none;
    margin-bottom: 4px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-title:hover {
    text-decoration: underline;
}

.embed-description {
    font-size: 0.85rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.embed-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* Search Bar */
.search-container {
    margin-bottom: 1.5rem;
}

#search-bar {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #333;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

#search-bar:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 999;
    padding: 0;
    margin: 0;
}

.fab:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.fab img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 998;
    padding: 0;
    margin: 0;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.back-to-top img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tag Styles */
.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-color), #9b59b6);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Tag Selector Dropdown */
.tag-selector-wrapper {
    position: relative;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 20px;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, var(--accent-color), #9b59b6);
    color: white;
    border-radius: 15px;
    font-size: 0.85rem;
}

.selected-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    margin-left: 0.2rem;
}

.selected-tag .remove:hover {
    opacity: 1;
}

.btn-add-tag {
    padding: 0.5rem 0.9rem;
    background-color: #333;
    color: var(--text-color);
    border: 1px dashed #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-add-tag:hover {
    background-color: #444;
    border-color: var(--accent-color);
}

.tag-dropdown {
    position: absolute;
    background-color: var(--card-bg);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    min-width: 280px;
    max-height: 300px;
    overflow-y: auto;
}

.existing-tags {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    max-height: 180px;
    overflow-y: auto;
}

.existing-tag-item {
    padding: 0.6rem;
    background-color: #111;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.existing-tag-item:hover {
    background-color: #222;
    border-color: var(--accent-color);
}

.custom-tag-input {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #444;
}

.custom-tag-input input {
    flex: 1;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border: 1px solid #333;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.85rem;
}

.custom-tag-input input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.custom-tag-input button {
    padding: 0.5rem 0.85rem;
    background-color: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
}

.custom-tag-input button:hover {
    opacity: 0.9;
}

/* Filter Dropdown Styles */
.search-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-dropdown-container {
    position: relative;
}

.btn-secondary {
    background-color: #2f3136;
    color: var(--text-color);
    border: 1px solid #444;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-secondary:hover {
    background-color: #40444b;
    border-color: var(--accent-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    color: var(--text-color);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #2f3136;
}

.dropdown-item.selected {
    background-color: rgba(255, 181, 197, 0.1);
    /* Accent color with opacity */
    color: var(--accent-color);
}

.dropdown-item .checkbox {
    font-size: 1.1rem;
}

.dropdown-item.empty {
    color: var(--secondary-text);
    justify-content: center;
    cursor: default;
}

.dropdown-item.empty:hover {
    background-color: transparent;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    #user-info {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

.dropdown-divider {
    height: 1px;
    background-color: #333;
    margin: 0.4rem 0;
}

.dropdown-item.clear-all {
    color: #DA373C;
    font-weight: 500;
}

.dropdown-item.clear-all:hover {
    background-color: rgba(218, 55, 60, 0.1);
}