/* Custom styles for Black Hole - Bootstrap 5 based */

/* Sidebar custom styles */
#sidebar-wrapper {
    height: 100vh;
    width: 250px;
    max-width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    position: fixed;
    z-index: 1040;
    display: flex;
    flex-direction: column;
}

/* Burger mode - sidebar hidden, shown as overlay when opened */
#sidebar-wrapper.burger-mode {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

#sidebar-wrapper.burger-mode.open {
    transform: translateX(0);
}

.sidebar-heading {
    min-height: 60px;
    flex-shrink: 0;
}

.list-group {
    flex-shrink: 0;
}

.user-info-section {
    margin-top: auto;
    flex-shrink: 0;
}

/* Burger button */
#burger-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1030;
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
}

#sidebar-wrapper.burger-mode ~ #page-content-wrapper #burger-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay for burger mode */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Adjust page content when sidebar is in burger mode */
#sidebar-wrapper.burger-mode ~ #page-content-wrapper {
    margin-left: 0;
    width: 100%;
}

/* Page wrapper */
#wrapper {
    min-height: 100vh;
}

#page-content-wrapper {
    min-width: 0;
    margin-left: 250px;
}

/* Event status badges */
.badge.status-upcoming {
    background-color: rgba(25, 135, 84, 0.2);
    color: #198754;
    border: 1px solid #198754;
}

.badge.status-in_progress {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.badge.status-completed {
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.badge.status-cancelled {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.badge.status-draft {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
    border: 1px solid #0d6efd;
}

/* Event cards hover effect */
.event-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Roster slot styles */
.roster-slot-discord {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

/* Drag handle for slots */
.slot-drag-handle {
    cursor: grab;
    padding: 0.5rem;
    margin-right: 0.5rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.slot-drag-handle:hover {
    color: var(--primary-color);
}

.slot-drag-handle:active {
    cursor: grabbing;
}

/* Slot dragging state */
.roster-slot-discord.slot-dragging {
    opacity: 0.5;
    transform: scale(0.98);
    cursor: grabbing;
}

/* Drag-over indicators */
.roster-slot-discord.slot-drag-over-top {
    border-top: 3px solid var(--primary-color);
    margin-top: 0.5rem;
}

.roster-slot-discord.slot-drag-over-bottom {
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 0.5rem;
}

.roster-slot.empty {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile responsive adjustments */
@media (max-width: 767.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        z-index: 1040;
    }
    
    #sidebar-wrapper.open {
        transform: translateX(0);
    }
    
    #page-content-wrapper {
        width: 100%;
        margin-left: 0;
    }
    
    #burger-toggle {
        display: none !important;
    }
}

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
    .event-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom scrollbar for sidebar */
#sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: #212529;
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 3px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Event view page styles */
.event-view-container .info-block {
    display: flex;
    align-items: start;
    gap: 12px;
}

.event-view-container .info-block i {
    font-size: 1.25rem;
    margin-top: 2px;
}

.event-view-container .info-content {
    flex: 1;
}

.event-view-container .info-content small {
    display: block;
    margin-bottom: 4px;
}

.event-description {
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Voice channel selector */
.voice-channel-selector .input-group {
    max-width: 100%;
}

.voice-channels-list .list-group-item {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.voice-channels-list .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Discord-style roster */
.roster-card {
    position: sticky;
    top: 20px;
}

.discord-roster {
    max-height: 600px;
    overflow-y: auto;
}

.roster-slot-discord {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.roster-slot-discord:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.roster-slot-discord.filled {
    background-color: rgba(25, 135, 84, 0.05);
}

.roster-slot-discord .slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #adb5bd;
}

.roster-slot-discord .slot-capacity {
    font-size: 0.75rem;
    color: #6c757d;
}

.roster-slot-discord .slot-participants {
    margin-bottom: 8px;
}

.roster-slot-discord .participant-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 1px;
    transition: background-color 0.15s ease;
}

.roster-slot-discord .participant-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.roster-slot-discord .participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.roster-slot-discord .participant-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.roster-slot-discord .btn-remove-participant {
    background: none;
    border: none;
    color: #dc3545;
    padding: 0px 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 1rem;
}

.roster-slot-discord .participant-item:hover .btn-remove-participant {
    opacity: 1;
}

.roster-slot-discord .btn-remove-participant:hover {
    color: #ff4d5a;
}

.roster-slot-discord .slot-empty {
    padding: 8px;
    color: #6c757d;
    font-size: 0.875rem;
}

.roster-slot-discord .slot-actions {
    margin-top: 8px;
}

/* Participant search */
.participant-search {
    position: relative;
}

.participant-search input {
    width: 100%;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2b3035;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.search-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content-based responsive layout for event view */
.event-content-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.event-main-column {
    flex: 2 1 600px;
    min-width: 0;
}

.event-roster-column {
    flex: 1 1 380px;
    min-width: 320px;
}


/* Responsive banner image */
#eventImagePreview {
    width: 100%;
    max-width: 433px;
    aspect-ratio: 433 / 96;
    object-fit: cover;
}

#eventImagePreviewArea {
    max-width: 433px;
}

/* Status badge variations */
.badge.status-черновик {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
    border: 1px solid #0d6efd;
}

.badge.status-планируется {
    background-color: rgba(25, 135, 84, 0.2);
    color: #198754;
    border: 1px solid #198754;
}

.badge.status-в_процессе {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.badge.status-завершено {
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.badge.status-отменено {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

/* Компактный Discord-подобный список участников */
.roster-list {
    /* Removed overflow and max-height to allow full content display */
}

.roster-slot-discord .participant-avatar {
    width: 12px;
    height: 12px;
}

.roster-slot-discord .participant-item {
    padding: 0px 8px;
    margin-bottom: 1px;
}

.roster-slot-discord .participant-name {
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .roster-list {
        /* Removed max-height to allow full content display on mobile */
    }
}

/* Inline edit buttons */
.btn-edit-inline {
    background: none;
    border: none;
    color: #6c757d;
    padding: 4px 8px;
    cursor: pointer;
    transition: opacity 0.2s ease, color 0.2s ease;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.event-field-inline:hover .btn-edit-inline,
.card-body:hover .btn-edit-inline {
    opacity: 1;
}

.btn-edit-inline:hover {
    color: #0d6efd;
}

.btn-edit-inline:active {
    color: #0a58ca;
}

/* Event field inline container */
.event-field-inline {
    position: relative;
}

.event-field-inline .field-value {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.event-field-inline .field-value.editing {
    display: none;
}

.event-field-inline .inline-edit-input,
.event-field-inline .inline-edit-textarea {
    display: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #0d6efd;
    color: inherit;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.event-field-inline .inline-edit-textarea {
    min-height: 80px;
    resize: vertical;
}

.event-field-inline.editing .inline-edit-input,
.event-field-inline.editing .inline-edit-textarea {
    display: block;
}

.event-field-inline .edit-actions {
    display: none;
    gap: 8px;
    margin-top: 8px;
}

.event-field-inline.editing .edit-actions {
    display: flex;
}

/* Description field value */
.field-value[data-field="description"] {
    white-space: pre-wrap;
    line-height: 1.6;
    /* Trim leading whitespace on first line */
    display: block;
}

.field-value[data-field="description"]::first-line {
    text-indent: 0;
}

/* Info block improvements */
.info-block {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 8px 0;
}

.info-block i {
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-content small {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.info-content strong {
    display: inline-block;
    word-break: break-word;
}

/* Search results improvements */
.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1d20;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: rgba(13, 110, 253, 0.15);
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Slot management styles */
.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.slot-header:hover {
    opacity: 0.8;
}

/* Slot editing two-row layout */
.slot-edit-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.slot-edit-row-1,
.slot-edit-row-2 {
    display: flex;
    align-items: center;
}

.slot-edit-row-1 {
    margin-bottom: 0.5rem;
}

.slot-header.editing {
    flex-wrap: wrap;
    align-items: flex-start;
}

.slot-edit-btn {
    background: none;
    border: none;
    color: #6c757d;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s ease, color 0.2s ease;
    font-size: 0.875rem;
}

.roster-slot-discord:hover .slot-edit-btn {
    opacity: 1;
}

.slot-edit-btn:hover {
    color: #0d6efd;
}

/* Drag and drop styles */
.roster-slot-discord.drag-over {
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed #0d6efd;
}

.participant-item.dragging {
    opacity: 0.5;
    cursor: move;
}

.participant-item[draggable="true"] {
    cursor: move;
}

.participant-item[draggable="true"]:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Modal for editing */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #1a1d20;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Description Editor Toolbar */
.description-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
}

.description-editor-toolbar + textarea {
    border-radius: 0 0 4px 4px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    color: #adb5bd;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.toolbar-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

.toolbar-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.toolbar-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.toolbar-select:focus {
    outline: none;
    border-color: #0d6efd;
    background: rgba(255, 255, 255, 0.08);
}

.toolbar-select option {
    background: #1a1d20;
    color: #fff;
}

/* Emoji Picker */
.emoji-picker-container {
    position: relative;
}

.emoji-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #1a1d20;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1060;
    width: 320px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.emoji-search {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emoji-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
}

.emoji-search input:focus {
    outline: none;
    border-color: #0d6efd;
    background: rgba(255, 255, 255, 0.08);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    padding: 12px;
    overflow-y: auto;
    max-height: 320px;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.emoji-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Scrollbar for emoji grid */
.emoji-grid::-webkit-scrollbar {
    width: 8px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Discord Markdown Formatting */
.discord-h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0.75em 0;
    color: #fff;
}

.discord-h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.75em 0;
    color: #fff;
}

.discord-h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.75em 0;
    color: #fff;
}

.discord-code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
}

.discord-codeblock {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
    margin: 0.5em 0;
}

.discord-codeblock code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    color: #f0f0f0;
}

.discord-spoiler {
    background: rgba(0, 0, 0, 0.6);
    color: transparent;
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.discord-spoiler:hover {
    background: rgba(0, 0, 0, 0.5);
}

.discord-spoiler.revealed {
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
}

.discord-quote {
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    padding-left: 12px;
    margin: 0.5em 0;
    color: rgba(255, 255, 255, 0.8);
}

.discord-list {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.discord-list-item {
    margin: 0.25em 0;
}

/* Default slots section */
.default-slots-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 12px;
    margin-top: 16px;
}

.default-slots-section .roster-slot-discord {
    background: rgba(255, 255, 255, 0.03);
}

.default-slots-section .roster-slot-discord:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Nickname formatting */
.nickname-blsk-tag {
    font-weight: normal;
    opacity: 0.5;
}

.nickname-bracket {
    font-weight: normal;
    opacity: 0.7;
}

.nickname-text {
    font-weight: normal;
    opacity: 1;
}

/* User Cell - Global Component */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #6c757d;
}

.user-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    display: inline-block;
    max-width: 100%;
}

.user-name span {
    white-space: nowrap;
    display: inline;
}

.user-name .nickname-text {
    opacity: 1;
}

.user-name .nickname-bracket,
.user-name .nickname-blsk-tag {
    opacity: 0.7;
    font-weight: 500;
}

.user-cell.flex-nowrap {
    flex-wrap: nowrap;
}

.user-cell.flex-nowrap .user-name {
    max-width: none;
}

/* Archive section styles */
.list-group-item {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.list-group-item h5 {
    color: #fff;
    font-size: 1.1rem;
}

/* Pagination styles */
.pagination {
    margin-top: 1.5rem;
}

.page-link {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.page-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.page-item.disabled .page-link {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: #6c757d;
}

/* Archive search input */
.input-group .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.input-group .form-control:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group-text {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

/* Calendar Filter Card */
.calendar-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s ease;
}

.calendar-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Custom Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.calendar-header span {
    font-size: 1rem;
    color: #fff;
}

.calendar-container {
    width: 100%;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #adb5bd;
    padding: 4px;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    border: 1px solid transparent;
    position: relative;
}

.calendar-day:not(.empty):hover {
    background: rgba(13, 110, 253, 0.2);
    border-color: rgba(13, 110, 253, 0.4);
}

.calendar-day.empty {
    cursor: default;
    opacity: 0;
}

.calendar-day.today {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    font-weight: 600;
}

.calendar-day.selected {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 600;
}

.calendar-day.in-range {
    background: rgba(13, 110, 253, 0.3);
    border-color: rgba(13, 110, 253, 0.5);
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #198754;
    border-radius: 50%;
}

.calendar-day.selected.has-event::after,
.calendar-day.in-range.has-event::after {
    background: #fff;
}

/* Flatpickr Dark Theme Customization */
.flatpickr-calendar {
    background: #1a1d20 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-months {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.flatpickr-current-month {
    color: #fff !important;
}

.flatpickr-monthDropdown-months {
    background: #1a1d20 !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.flatpickr-monthDropdown-months:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.numInputWrapper:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.flatpickr-weekdays {
    background: rgba(255, 255, 255, 0.03) !important;
}

.flatpickr-weekday {
    color: #adb5bd !important;
    font-weight: 600 !important;
}

.flatpickr-day {
    color: #fff !important;
    border: 1px solid transparent !important;
}

.flatpickr-day:hover {
    background: rgba(13, 110, 253, 0.2) !important;
    border-color: rgba(13, 110, 253, 0.4) !important;
}

.flatpickr-day.today {
    border-color: #0d6efd !important;
    background: rgba(13, 110, 253, 0.1) !important;
}

.flatpickr-day.selected {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

.flatpickr-day.inRange {
    background: rgba(13, 110, 253, 0.3) !important;
    border-color: rgba(13, 110, 253, 0.5) !important;
    box-shadow: none !important;
}

.flatpickr-day.disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #6c757d !important;
}

/* Highlight days with events */
.flatpickr-day.has-event {
    position: relative;
}

.flatpickr-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #198754;
    border-radius: 50%;
}

.flatpickr-day.has-event.selected::after,
.flatpickr-day.has-event.startRange::after,
.flatpickr-day.has-event.endRange::after {
    background: #fff;
}

.flatpickr-day.has-event.inRange::after {
    background: #0d6efd;
}

/* Flatpickr navigation arrows */
.flatpickr-prev-month,
.flatpickr-next-month {
    color: #fff !important;
    fill: #fff !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: #0d6efd !important;
    fill: #0d6efd !important;
}

/* Compact Event Cards */
.event-card-compact {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.event-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Event Banner */
.event-banner {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #1a1d20 0%, #2d3748 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 12px;
}

.event-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.event-status-badge {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
}

/* Event Meta Information */
.event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #adb5bd;
}

.meta-item i {
    font-size: 1rem;
    color: #6c757d;
    flex-shrink: 0;
}

.meta-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading state */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Fade in animation for events */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card-compact {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive adjustments for calendar */
@media (max-width: 767.98px) {
    .calendar-card {
        margin-bottom: 1rem;
    }
    
    .event-banner {
        height: 100px;
    }
    
    .flatpickr-calendar {
        width: 100% !important;
    }
}

/* Empty state improvements */
.text-center.py-5 i.display-1 {
    opacity: 0.3;
}

.text-center.py-5 h3 {
    color: #fff;
}

.text-center.py-5 .text-muted {
    color: #adb5bd !important;
}

/* Sidebar Calendar Styles */
.sidebar-calendar-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 8px;
}

#sidebar-calendar .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0;
}

#sidebar-calendar .calendar-header span {
    font-size: 0.875rem;
    color: #fff;
    font-weight: 600;
}

#sidebar-calendar .calendar-header button {
    padding: 2px 6px;
    font-size: 0.75rem;
}

#sidebar-calendar .calendar-weekday {
    font-size: 0.65rem;
    padding: 2px;
}

#sidebar-calendar .calendar-days {
    gap: 2px;
}

#sidebar-calendar .calendar-day {
    aspect-ratio: 1;
    font-size: 0.75rem;
    padding: 2px;
}

/* Color-coded event markers for sidebar calendar */
#sidebar-calendar .calendar-day.has-event::after {
    display: none;
}

#sidebar-calendar .calendar-day.has-event {
    position: relative;
    font-weight: 600;
}

/* Multiple status markers */
#sidebar-calendar .calendar-day[data-statuses]::before {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    border-radius: 1px;
}

/* Single status colors */
#sidebar-calendar .calendar-day[data-statuses="Планируется"]::before {
    background: #0d6efd;
}

#sidebar-calendar .calendar-day[data-statuses="В процессе"]::before {
    background: #198754;
}

#sidebar-calendar .calendar-day[data-statuses="Черновик"]::before {
    background: #6c757d;
}

#sidebar-calendar .calendar-day[data-statuses="Отменено"]::before {
    background: #dc3545;
}

#sidebar-calendar .calendar-day[data-statuses="Завершено"]::before {
    background: #5a6c5d;
}

/* Multiple statuses - gradient */
#sidebar-calendar .calendar-day.has-multiple-statuses::before {
    background: linear-gradient(to right, #0d6efd 0%, #198754 50%, #6c757d 100%);
}

#sidebar-calendar #cal-clear-filter {
    font-size: 0.75rem;
    padding: 4px 8px;
}

#sidebar-calendar #cal-filter-info {
    font-size: 0.7rem;
}

/* Compact button styling */
#sidebar-calendar .btn-sm {
    padding: 2px 6px;
    font-size: 0.75rem;
}

/* Mobile sidebar calendar */
@media (max-width: 767.98px) {
    .sidebar-calendar-container {
        padding: 12px;
    }
    
    #sidebar-calendar .calendar-header span {
        font-size: 0.9rem;
    }
    
    #sidebar-calendar .calendar-day {
        aspect-ratio: 0.8;
        font-size: 0.8rem;
    }
}
