@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rubik:wght@300;400;600;700&display=swap');

/* Global Variables */
:root {
    --color-orange: #f97316;
    --color-blue: #60a5fa;
    --color-green: #10b981;
    --color-red: #ef4444;
    --color-purple: #a855f7;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    background: linear-gradient(to bottom right, #0f172a, #1e293b);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
.orbitron {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

/* Channel Button Styles */
.channel-button {
    position: relative;
    transition: all 0.2s ease;
}

.channel-button:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

.channel-button.active {
    background-color: rgba(55, 65, 81, 0.7);
    border-left: 4px solid var(--color-orange);
}

.channel-button.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--color-orange);
    border-radius: 0 4px 4px 0;
}

/* Section Headers */
.section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    user-select: none;
}

/* Mobile Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 64px;
        height: calc(100dvh - 64px);
        width: 280px;
        z-index: 50;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scroll to bottom button animation */
#scrollToBottomBtn {
    animation: slideIn 0.3s ease;
}

#scrollToBottomBtn:hover {
    animation: bounce 0.5s ease infinite;
}

/* Tab Transition Animations */
#loginForm, #registerForm {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#loginForm.hidden, #registerForm.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

/* Tab Button Transitions */
#loginTab, #registerTab {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#loginTab::after, #registerTab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-orange);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#loginTab.bg-orange-500::after, #registerTab.bg-orange-500::after {
    width: 80%;
}

/* Smooth tab button hover effect */
#loginTab:not(.bg-orange-500):hover,
#registerTab:not(.bg-orange-500):hover {
    background-color: rgba(249, 115, 22, 0.1);
    transform: translateY(-1px);
}

/* Input Focus Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-orange);
}

/* Button Styles */
button {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    transform: translateY(-1px);
}

button:not(:disabled):active {
    transform: translateY(0);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

/* Card Styles */
.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(100, 116, 139, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-orange);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast/Notification Styles */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

/* Avatar Styles */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    user-select: none;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* Gradient Backgrounds */
.gradient-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.gradient-blue {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.gradient-green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-purple {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.gradient-rainbow {
    background: linear-gradient(135deg, #f97316, #60a5fa, #a855f7);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

/* Text Selection */
::selection {
    background: var(--color-orange);
    color: white;
}

::-moz-selection {
    background: var(--color-orange);
    color: white;
}

/* Print Styles */
@media print {
    .sidebar,
    button,
    .no-print {
        display: none !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible (for keyboard navigation) */
*:focus-visible {
    outline: 2px solid var(--color-orange);
    outline-offset: 2px;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--color-orange), var(--color-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.backdrop-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass {
    background: rgba(30, 41, 59, 0.3);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(71, 85, 105, 0.3);
}

/* Message Styles */
.message-enter {
    animation: slideIn 0.2s ease;
}

.message-highlight {
    background: rgba(249, 115, 22, 0.1);
    border-left: 3px solid var(--color-orange);
    padding-left: 0.75rem;
}

/* Responsive Typography */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
}

/* Dark Mode Enhancements (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}