/* ===== Smooth Transitions ===== */

/* Global smooth transitions for interactive elements */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Buttons - smooth hover and click effects */
.btn, button, a.btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.btn:hover, button:hover, a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active, button:active, a.btn:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

/* Primary button glow effect */
.btn.primary:hover {
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ghost button subtle effect */
.btn.ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ===== Input Fields ===== */

/* Focus state with smooth animation */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #5865f2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
    outline: none;
    transform: scale(1.01);
}

/* Placeholder fade on focus */
input::placeholder,
textarea::placeholder {
    transition: opacity 0.2s ease;
}

input:focus::placeholder,
textarea:focus::placeholder {
    opacity: 0.5;
}

/* ===== Cards ===== */

/* Card hover lift effect */
.card, .glass, .feature-card, .step-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .glass:hover, .feature-card:hover, .step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ===== Navigation Links ===== */

.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #5865f2, #7289da);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===== Language Switcher ===== */

.lang-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

.lang-btn:hover {
    opacity: 0.9;
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.5);
}

/* ===== Theme Toggle ===== */

.theme-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    background-color: rgba(88, 101, 242, 0.15);
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.3);
}

.theme-icon-dark,
.theme-icon-light {
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon-dark,
.theme-toggle:hover .theme-icon-light {
    transform: rotate(20deg);
}

/* ===== Dropdown Menus ===== */

.nav-more-menu,
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-more:hover .nav-more-menu,
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ===== Modal/Dialog Animations ===== */

.modal-overlay {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

/* ===== Toast Notifications ===== */

.toast {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* ===== Loading Spinner ===== */

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pulse animation for loading states */
.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Fade In Animation ===== */

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered fade in for lists */
.fade-in-stagger > * {
    opacity: 0;
    animation: fadeInStagger 0.4s ease forwards;
}

.fade-in-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.fade-in-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.fade-in-stagger > *:nth-child(8) { animation-delay: 0.4s; }
.fade-in-stagger > *:nth-child(9) { animation-delay: 0.45s; }
.fade-in-stagger > *:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInStagger {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Slide Animations ===== */

.slide-in-left {
    animation: slideInLeft 0.3s ease forwards;
}

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

.slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Channel Selector (like screenshot) ===== */

.channel-selector {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.channel-selector.open {
    max-height: 300px;
    overflow-y: auto;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.channel-item:hover {
    background-color: rgba(88, 101, 242, 0.1);
}

.channel-item.selected {
    background-color: rgba(88, 101, 242, 0.2);
}

.channel-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #5865f2;
    transition: transform 0.2s ease;
}

.channel-item:hover .channel-checkbox {
    transform: scale(1.1);
}

.channel-name {
    font-weight: 500;
    transition: color 0.2s ease;
}

.channel-item:hover .channel-name {
    color: #5865f2;
}

/* ===== Multi-select Dropdown ===== */

.multi-select-container {
    position: relative;
}

.multi-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.multi-select-trigger:hover {
    border-color: rgba(88, 101, 242, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.multi-select-trigger.active {
    border-color: #5865f2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 2px solid rgba(88, 101, 242, 0.3);
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.multi-select-dropdown.open {
    max-height: 250px;
    overflow-y: auto;
}

/* ===== Search Input with Icon ===== */

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    padding-left: 40px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.search-input-wrapper input:focus + .search-icon {
    opacity: 1;
    color: #5865f2;
}

/* ===== Status Indicators ===== */

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-indicator.online {
    background: #43b581;
    box-shadow: 0 0 8px rgba(67, 181, 129, 0.5);
}

.status-indicator.offline {
    background: #747f8d;
}

.status-indicator.idle {
    background: #faa61a;
    box-shadow: 0 0 8px rgba(250, 166, 26, 0.5);
}

/* ===== Progress Bar ===== */

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5865f2, #7289da);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Tooltip ===== */

.tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

[data-tooltip]:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== Badge Animations ===== */

.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* ===== Table Row Hover ===== */

.table-row {
    transition: all 0.2s ease;
}

.table-row:hover {
    background-color: rgba(88, 101, 242, 0.05);
    transform: scale(1.01);
}

/* ===== Scrollbar Styling ===== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.5);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 101, 242, 0.7);
}

/* ===== Page Transition ===== */

.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ===== Responsive Animations ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
