/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #36393f;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #5865f2;
    max-width: 350px;
    animation: toastSlideIn 0.3s ease-out;
}

.toast.success {
    border-left-color: #3ba55c;
}

.toast.error {
    border-left-color: #ed4245;
}

.toast.warning {
    border-left-color: #faa61a;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.875rem;
    color: #b9bbbe;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #36393f;
    border: 1px solid #40444b;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    color: #dcddde;
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.1s ease;
}

.dropdown-item:hover {
    background: #40444b;
}

.dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

.dropdown-divider {
    height: 1px;
    background: #40444b;
    margin: 4px 0;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #36393f;
    border: 1px solid #40444b;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 160px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.1s ease;
}

.context-menu.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    color: #dcddde;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.1s ease;
}

.context-menu-item:hover {
    background: #40444b;
}

.context-menu-item.danger {
    color: #ed4245;
}

.context-menu-item.danger:hover {
    background: #ed4245;
    color: #ffffff;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #40444b;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #5865f2;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-fill.success {
    background: #3ba55c;
}

.progress-fill.error {
    background: #ed4245;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    width: 120px;
    background: #23272a;
    color: #ffffff;
    text-align: center;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #23272a transparent transparent transparent;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #72767d;
    transition: 0.2s;
    border-radius: 12px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked + .switch-slider {
    background: #3ba55c;
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Chip/Tag */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #40444b;
    color: #dcddde;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 6px;
}

.chip.primary {
    background: #5865f2;
    color: #ffffff;
}

.chip.success {
    background: #3ba55c;
    color: #ffffff;
}

.chip.danger {
    background: #ed4245;
    color: #ffffff;
}

.chip-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chip-close:hover {
    opacity: 1;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #40444b;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: rgba(64, 68, 75, 0.1);
}

.file-upload-area.dragover {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.1);
}

.file-upload-area:hover {
    border-color: #72767d;
}

.file-upload-icon {
    font-size: 2rem;
    color: #8e9297;
    margin-bottom: 12px;
}

.file-upload-text {
    color: #dcddde;
    font-weight: 500;
    margin-bottom: 4px;
}

.file-upload-hint {
    color: #8e9297;
    font-size: 0.875rem;
}

/* Status Indicator */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #72767d;
}

.status-indicator.online {
    background: #3ba55c;
}

.status-indicator.away {
    background: #faa61a;
}

.status-indicator.busy {
    background: #ed4245;
}

.status-indicator.offline {
    background: #72767d;
}

/* Skeleton Loading */
.skeleton {
    background: #40444b;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    height: 2.5rem;
    width: 80px;
}