/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Apple Color Emoji', sans-serif;
    background-image: url('https://files.catbox.moe/7b9m4r.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: #1a1a1a;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(0, 0, 0, 0.1) 100%);
    z-index: -1;
}

/* Auto-typing display at top */
.typing-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #00ff88;
    padding: 15px 20px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
}

.cursor {
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
    padding-top: 60px;
}

.page.active {
    display: block;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    transform: translateZ(0);
    will-change: transform;
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-card h1 i {
    margin-right: 10px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    margin: 20px;
    transform: translateZ(0);
    will-change: transform;
    transition: all 0.3s ease;
}

.header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.header h1 {
    color: #667eea;
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #2d3748;
    font-weight: 500;
}

/* Navigation Styles */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #667eea;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
    color: #4c63d2;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

/* Purple styling for bug attack button */
.nav-btn-purple {
    background: rgba(139, 0, 139, 0.2) !important;
    border-color: rgba(139, 0, 139, 0.3) !important;
    color: #8B008B !important;
}

.nav-btn-purple:hover {
    background: rgba(139, 0, 139, 0.3) !important;
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(139, 0, 139, 0.25);
}

.nav-btn-purple.active {
    background: rgba(139, 0, 139, 0.3) !important;
    color: #8B008B !important;
    box-shadow: 0 8px 32px rgba(139, 0, 139, 0.3);
}

.nav-btn i {
    margin-right: 8px;
}

.admin-only {
    display: none;
}

.admin-only.show {
    display: block;
}

/* Content Styles */
.main-content {
    margin: 20px;
    text-align: center;
}

.welcome-message {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    transform: translateZ(0);
    will-change: transform;
    transition: all 0.3s ease;
}

.welcome-message:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.16);
}

.welcome-message h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 600;
}

.content {
    margin: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 500;
}

.form-group label i {
    margin-right: 5px;
    color: #667eea;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1a1a1a;
}

.form-control:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
    color: rgba(26, 26, 26, 0.6);
}

/* Button Styles */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    transform: translateZ(0);
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: rgba(102, 126, 234, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: rgba(102, 126, 234, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(108, 117, 125, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 8px 32px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: rgba(108, 117, 125, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(108, 117, 125, 0.4);
}

.btn-success {
    background: rgba(40, 167, 69, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: rgba(40, 167, 69, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: rgba(220, 53, 69, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: rgba(255, 193, 7, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #212529;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background: rgba(255, 193, 7, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.4);
}

/* Purple button style for bug attacks */
.btn-purple {
    background: rgba(139, 0, 139, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 8px 32px rgba(139, 0, 139, 0.3);
}

.btn-purple:hover {
    background: rgba(139, 0, 139, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 0, 139, 0.4);
}

.btn-info {
    background: rgba(23, 162, 184, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 8px 32px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    background: rgba(23, 162, 184, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(23, 162, 184, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.5);
    color: #667eea;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.btn-outline:hover {
    background: rgba(102, 126, 234, 0.8);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.card h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.card h3 i {
    margin-right: 10px;
}

.warning-card {
    border-left: 4px solid rgba(255, 193, 7, 0.8);
    background: rgba(255, 193, 7, 0.05);
}

.warning-card h3 {
    color: #ffc107;
}

/* Purple warning card for bug attacks */
.warning-card-purple {
    border-left: 4px solid rgba(139, 0, 139, 0.8);
    background: rgba(139, 0, 139, 0.05);
}

.warning-card-purple h3 {
    color: #8B008B;
}

/* Pairing Code Styles */
.pairing-code {
    background: rgba(248, 249, 250, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.pairing-code h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 600;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.code-display span {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Sessions List Styles */
.sessions-list {
    list-style: none;
    padding: 0;
}

.sessions-list li {
    background: rgba(248, 249, 250, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.sessions-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.sessions-list li i {
    margin-right: 8px;
    color: #667eea;
}

.status-connected {
    color: #28a745;
    font-weight: 500;
}

.status-disconnected {
    color: #dc3545;
    font-weight: 500;
}

/* Status Messages */
.status-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.error-message {
    background: rgba(248, 215, 218, 0.2);
    color: #721c24;
    border: 1px solid rgba(245, 198, 203, 0.3);
}

.success-message {
    background: rgba(212, 237, 218, 0.2);
    color: #155724;
    border: 1px solid rgba(195, 230, 203, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .typing-display {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .code-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .sessions-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
        margin: 12px;
    }
    
    .header {
        margin: 12px;
    }
    
    .main-nav {
        margin: 12px;
    }
    
    .content {
        margin: 12px;
    }
    
    .card {
        padding: 20px;
    }
    
    .typing-display {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* Performance Optimizations */
.card,
.nav-btn,
.btn,
.header,
.login-card {
    contain: layout style paint;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .nav-btn,
    .btn,
    .header,
    .login-card {
        border-width: 2px;
    }
}
