html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Layout wrapper for sidebar + main content */
.layout-wrapper {
    display: flex;
    flex: 1 0 auto;
    min-height: calc(100vh - 80px); /* Adjust based on header height */
}

/* Sidebar Navigation */
.sidebar {
    width: 200px;
    background-color: #2c3e50;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.sidebar-nav .nav-item {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    border-bottom: 1px solid #34495e;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.sidebar-nav .nav-item:hover {
    background-color: #3498db;
    color: white;
    transform: translateX(5px);
}

.sidebar-nav .nav-item:active,
.sidebar-nav .nav-item.active {
    background-color: #2980b9;
    color: white;
    border-left: 4px solid #e74c3c;
}

/* Navigation Groups */
.nav-group {
    margin-bottom: 2px;
}

.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #34495e;
    color: #ecf0f1;
    cursor: pointer;
    border-bottom: 1px solid #2c3e50;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.nav-group-header:hover {
    background-color: #3498db;
    color: white;
}

.nav-group-title {
    flex: 1;
}

.nav-group-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    font-style: normal;
}

.nav-group-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    background-color: #2c3e50;
}

.nav-group.active .nav-group-header {
    background-color: #3498db;
    color: white;
}

.nav-item.sub-item {
    padding: 12px 20px 12px 40px;
    font-size: 13px;
    font-weight: 400;
    border-bottom: 1px solid #34495e;
    background-color: #2c3e50;
}

.nav-item.sub-item:hover {
    background-color: #e74c3c;
    color: white;
    transform: translateX(8px);
}

.nav-item.sub-item:active,
.nav-item.sub-item.active {
    background-color: #c0392b;
    color: white;
    border-left: 4px solid #f39c12;
}

/* Main content area */
.main-content {
    flex: 1;
    padding: 0;
    overflow-x: auto;
    background-color: #ffffff;
}

/* Main content when sidebar is hidden */
.main-content.no-sidebar {
    width: 100%;
    margin-left: 0;
}

main {
    flex: 1 0 auto;
    margin: 0 auto;
    max-width: 1280px;
}
.base-container {
    padding: 20px 0 20px 0;
}

/* Simple footer styling */
footer.simple-footer {
    background-color: #3f52ae;
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    flex-shrink: 0;
}

footer.simple-footer a {
    color: #fff;
    text-decoration: none;
}

footer.simple-footer a:hover {
    text-decoration: underline;
}

/* Messages and Alerts Styling */
.messages-container {
    margin: 20px 0;
    z-index: 1000;
}

.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.5s ease-out;
}

.alert-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-left: 4px solid #155724;
}

.alert-success::before {
    content: "✅ ";
    font-size: 1.2em;
    margin-right: 8px;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
    font-size: 1.2em;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.btn-close:hover {
    opacity: 1;
}

/* Slide-in animation for alerts */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auto-hide animation after 4 seconds */
.alert.fade.show {
    animation: slideInDown 0.5s ease-out, fadeOut 0.5s ease-in 4s forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(-20px);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Hashtag Input Styles */
.hashtag-input-wrapper {
    position: relative;
}

#hashtag-input-container {
    white-space: pre-wrap;
    word-wrap: break-word;
    padding-right: 20px; /* space for cursor */
}

#hashtag-input-container .hashtag-highlight {
    background-color: #d4edda;
    color: #155724;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 500;
}

/* Obsidian-like tag chips */
#hashtag-input-container .tag-chip {
    background: #cfe2ff; /* A pleasant light blue */
    color: #052c65;      /* A matching dark blue for text */
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px 4px 2px 0;
    display: inline-block;
    font-weight: 500;
    line-height: 1.6;
}

#hashtag-input-container .tag-chip .remove {
    margin-left: 6px;
    cursor: pointer;
    color: #5a8de6; /* A matching blue for the remove icon */
}

/* Suggestions dropdown */
#tag-suggestions {
    position: relative;
    margin-top: 6px;
}

#tag-suggestions .dropdown {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

#tag-suggestions .item {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#tag-suggestions .item:hover,
#tag-suggestions .item.active {
    background: #f3f1ff;
}

#tag-suggestions .usage { 
    color: #6c757d; 
    font-size: 12px; 
}