/* Custom styles for KOJIE AI Software Engineering Platform */

:root {
    --kojie-primary: #0dcaf0;
    --kojie-secondary: #6c757d;
    --kojie-success: #198754;
    --kojie-warning: #ffc107;
    --kojie-danger: #dc3545;
    --kojie-dark: #212529;
    
    /* Cyberpunk Color Palette */
    --cyber-neon-cyan: #00ffff;
    --cyber-neon-purple: #ff00ff;
    --cyber-neon-green: #00ff00;
    --cyber-neon-orange: #ff8c00;
    --cyber-neon-pink: #ff1493;
    --cyber-neon-blue: #0080ff;
    --cyber-dark-bg: rgba(5, 5, 15, 0.95);
    --cyber-card-bg: rgba(10, 10, 30, 0.8);
    --cyber-glass-bg: rgba(15, 15, 35, 0.7);
    --cyber-border: rgba(0, 255, 255, 0.3);
    --cyber-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    --cyber-text-primary: #ffffff;
    --cyber-text-secondary: rgba(255, 255, 255, 0.8);
    --cyber-text-muted: rgba(255, 255, 255, 0.6);
    
    /* Interactive Widget Variables */
    --cyber-primary-rgb: 13, 202, 240;
    --cyber-neon-rgb: 0, 255, 255;
    --cyber-success-rgb: 25, 135, 84;
    --cyber-warning-rgb: 255, 193, 7;
    --cyber-danger-rgb: 220, 53, 69;
}

/* Fix potential layout issues */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.container, .container-fluid {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Ensure navbar stays at top */
.navbar {
    position: relative !important;
    top: auto !important;
    z-index: 1030;
}

/* Fix dropdown positioning */
.navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--kojie-dark) 0%, #2c3e50 100%);
    min-height: 80vh;
}

.min-vh-75 {
    min-height: 75vh;
}

/* Cards and Shadows */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Feature Icons */
.feature-icon img {
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.feature-icon:hover img {
    transform: scale(1.05);
}

/* Technology Stack Icons */
.tech-item i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.tech-item:hover i {
    transform: translateY(-5px);
    color: var(--kojie-primary) !important;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    color: #ffffff !important; /* Ensure home button is always white for visibility */
}

.navbar-brand:hover {
    color: var(--kojie-primary) !important; /* Cyan color on hover */
}

.navbar-brand .text-muted {
    color: rgba(255, 255, 255, 0.7) !important; /* Lighter white for subtitle */
}

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

.navbar-nav .nav-link:hover {
    color: var(--kojie-primary) !important;
}

/* Buttons */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Code Editor Styles */
.CodeMirror {
    height: 100%;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
}

.CodeMirror-scroll {
    max-height: 500px;
}

/* Chat Messages */
.message {
    animation: fadeInUp 0.3s ease;
}

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

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--kojie-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* File Explorer */
.list-group-item {
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: var(--bs-secondary) !important;
    color: var(--bs-white) !important;
}

.list-group-item.active {
    background-color: var(--bs-info) !important;
    color: var(--bs-white) !important;
    border-color: var(--bs-info) !important;
}

/* Error Pages */
.error-page i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Dashboard Stats Cards */
.card-body i {
    transition: transform 0.3s ease;
}

.card:hover .card-body i {
    transform: scale(1.1);
}

/* Modal Enhancements */
.modal-content {
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

/* Progress Indicators */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Enhanced Mobile Responsive Optimizations */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .display-5 {
        font-size: 2.5rem;
    }
    
    /* Mobile-optimized feature cards */
    .feature-card, .card {
        margin-bottom: 1.5rem;
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .feature-card h5, .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }
    
    .feature-card p, .card-text {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    /* Enhanced mobile buttons */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 8px;
        font-weight: 500;
    }
    
    .btn-sm {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: 16px 24px;
        font-size: 1.1rem;
    }
    
    /* Enhanced mobile navigation */
    .navbar-brand {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    .navbar-brand .text-muted {
        display: none; /* Hide subtitle on mobile for space */
    }
    
    .navbar-toggler {
        padding: 8px 12px;
        border: none;
        border-radius: 8px;
        min-height: 44px;
        min-width: 44px;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.25);
    }
    
    .navbar-nav .nav-link {
        padding: 16px 20px;
        font-size: 1rem;
        border-radius: 8px;
        margin: 2px 0;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .navbar-nav .nav-link i {
        width: 20px;
        text-align: center;
    }
    
    /* Mobile dropdown improvements */
    .navbar-nav .dropdown-menu {
        border: none;
        border-radius: 12px;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
        margin-top: 0.5rem;
        min-width: 250px;
    }
    
    .navbar-nav .dropdown-item {
        padding: 12px 20px;
        font-size: 0.95rem;
        border-radius: 8px;
        margin: 2px 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .navbar-nav .dropdown-item i {
        width: 20px;
        text-align: center;
        margin-right: 12px;
    }
    
    /* Mobile-specific navbar collapse */
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile navbar spacing */
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav.me-auto {
        margin-bottom: 1rem !important;
    }
    
    /* Mobile card improvements */
    .card-body {
        padding: 1.25rem;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
        font-weight: 600;
    }
    
    /* Mobile text optimization for better readability */
    h1 { font-size: 1.8rem; line-height: 1.2; margin-bottom: 1rem; }
    h2 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 0.875rem; }
    h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 0.75rem; }
    h4 { font-size: 1.1rem; line-height: 1.4; margin-bottom: 0.75rem; }
    h5 { font-size: 1rem; line-height: 1.4; margin-bottom: 0.5rem; }
    h6 { font-size: 0.9rem; line-height: 1.4; margin-bottom: 0.5rem; }
    
    /* Mobile spacing improvements */
    .container, .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Mobile list group optimization */
    .list-group-item {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    /* Mobile badge optimization */
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.65em;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .hero-section h1 {
        font-size: 1.6rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 0.95rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    /* Ultra-mobile button optimization */
    .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0;
    }
    
    /* Mobile project cards */
    .project-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    /* Mobile form improvements */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        min-height: 48px;
        border-radius: 8px;
    }
    
    .form-select {
        font-size: 16px;
        padding: 12px 16px;
        min-height: 48px;
        border-radius: 8px;
    }
    
    /* Mobile table responsiveness */
    .table-responsive {
        border: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .table {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Mobile modal optimization */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Mobile dropdown optimization */
    .dropdown-menu {
        font-size: 0.9rem;
        min-width: 200px;
    }
    
    .dropdown-item {
        padding: 0.5rem 1rem;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .btn,
    .form-control,
    .form-select,
    .nav-link,
    .list-group-item-action {
        min-height: 44px;
    }
    
    /* Larger tap areas for better touch interaction */
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Enhanced hover states for touch */
    .card:active {
        transform: translateY(0);
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    }
}

/* Mobile Image and Graphics Optimization */
@media (max-width: 768px) {
    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: optimize-contrast;
    }
    
    /* Feature icons optimization */
    .feature-icon img,
    .card-img-top {
        width: 100%;
        max-width: 64px;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
    }
    
    /* Hero images */
    .hero-image {
        max-width: 100%;
        height: auto;
        margin-bottom: 1rem;
    }
    
    /* Logo optimization */
    .navbar-brand img,
    .logo {
        max-height: 32px;
        width: auto;
    }
    
    /* Avatar images */
    .avatar,
    .profile-image {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
    }
    
    /* Card images */
    .card-img,
    .card-img-top,
    .card-img-bottom {
        border-radius: 8px 8px 0 0;
        max-height: 200px;
        object-fit: cover;
    }
    
    /* Technology stack icons */
    .tech-item i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* Dashboard graphics */
    .chart-container,
    .graph-container {
        width: 100%;
        height: auto;
        overflow: hidden;
        border-radius: 8px;
    }
    
    /* SVG optimizations */
    svg {
        max-width: 100%;
        height: auto;
    }
    
    /* Background images */
    .bg-image {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}

/* High DPI/Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .feature-icon img {
        transform: scale(0.5);
        transform-origin: top left;
        width: 200%;
        max-width: 128px;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .card:hover {
        transform: none;
    }
    
    /* Optimize transitions */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improve scrolling performance */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* Optimize background images for mobile */
    .hero-section,
    .bg-gradient {
        background-attachment: scroll; /* Fixed backgrounds cause performance issues on mobile */
    }
}

/* Dark Theme Enhancements */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-gray-800) !important;
}

[data-bs-theme="dark"] .text-muted {
    color: var(--bs-gray-400) !important;
}

[data-bs-theme="dark"] .border {
    border-color: var(--bs-gray-700) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* Utility Classes */
.border-radius-lg {
    border-radius: 1rem !important;
}

.shadow-lg-soft {
    box-shadow: 0 0.75rem 1.5rem rgba(18, 38, 63, 0.03) !important;
}

.text-gradient {
    background: linear-gradient(45deg, var(--kojie-primary), #6f42c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* ===============================
   CYBERPUNK THEME SYSTEM
   =============================== */

/* Cyberpunk Body Background */
body.cyberpunk-theme {
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 255, 198, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, var(--cyber-dark-bg) 0%, rgba(15, 5, 25, 0.9) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--cyber-text-primary);
}

/* Cyberpunk Glass Morphism Cards */
.cyber-card {
    background: var(--cyber-card-bg) !important;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid var(--cyber-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--cyber-shadow), 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.3s ease;
}

.cyber-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), 0 12px 48px rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(0, 255, 255, 0.6) !important;
}

/* Cyberpunk Glass Container */
.cyber-glass {
    background: var(--cyber-glass-bg) !important;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Cyberpunk Chat Interface */
.cyber-chat-container {
    background: var(--cyber-card-bg) !important;
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid var(--cyber-border) !important;
    border-radius: 20px !important;
    box-shadow: var(--cyber-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.cyber-chat-messages {
    background: transparent !important;
    border-radius: 16px !important;
}

/* Cyberpunk Message Bubbles */
.cyber-message-user {
    background: linear-gradient(135deg, var(--cyber-neon-cyan), var(--cyber-neon-blue)) !important;
    color: rgba(0, 0, 0, 0.9) !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3) !important;
    border-radius: 18px 18px 4px 18px !important;
}

.cyber-message-ai {
    background: var(--cyber-glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--cyber-text-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-radius: 18px 18px 18px 4px !important;
}

/* Cyberpunk Neon Accents */
.cyber-neon-accent {
    border: 2px solid var(--cyber-neon-cyan) !important;
    box-shadow: 
        0 0 10px var(--cyber-neon-cyan),
        inset 0 0 10px rgba(0, 255, 255, 0.1) !important;
    animation: neonPulse 2s infinite alternate;
}

@keyframes neonPulse {
    from {
        box-shadow: 
            0 0 5px var(--cyber-neon-cyan),
            inset 0 0 5px rgba(0, 255, 255, 0.1);
    }
    to {
        box-shadow: 
            0 0 20px var(--cyber-neon-cyan),
            0 0 30px rgba(0, 255, 255, 0.3),
            inset 0 0 10px rgba(0, 255, 255, 0.2);
    }
}

/* Cyberpunk Buttons */
.btn-cyber-primary {
    background: linear-gradient(135deg, var(--cyber-neon-cyan), var(--cyber-neon-blue)) !important;
    border: none !important;
    color: rgba(0, 0, 0, 0.9) !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4) !important;
    transition: all 0.3s ease !important;
}

.btn-cyber-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6), 0 5px 15px rgba(0, 0, 0, 0.3) !important;
    background: linear-gradient(135deg, #00ffff, #0099ff) !important;
}

.btn-cyber-secondary {
    background: transparent !important;
    border: 2px solid var(--cyber-neon-cyan) !important;
    color: var(--cyber-neon-cyan) !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-cyber-secondary:hover {
    background: var(--cyber-neon-cyan) !important;
    color: rgba(0, 0, 0, 0.9) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
    transform: translateY(-1px) !important;
}

/* Cyberpunk Form Controls */
.form-control.cyber-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    color: var(--cyber-text-primary) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.form-control.cyber-input:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: var(--cyber-neon-cyan) !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3) !important;
    color: var(--cyber-text-primary) !important;
}

.form-control.cyber-input::placeholder {
    color: var(--cyber-text-muted) !important;
}

/* Cyberpunk Text Colors */
.cyber-text-primary { color: var(--cyber-text-primary) !important; }
.cyber-text-secondary { color: var(--cyber-text-secondary) !important; }
.cyber-text-muted { color: var(--cyber-text-muted) !important; }
.cyber-text-neon { color: var(--cyber-neon-cyan) !important; text-shadow: 0 0 10px rgba(0, 255, 255, 0.5); }

/* Cyberpunk Header Gradient */
.cyber-header {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.2) 0%, 
        rgba(255, 0, 255, 0.2) 50%,
        rgba(0, 255, 0, 0.2) 100%) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3) !important;
}

/* Cyberpunk Sidebar */
.cyber-sidebar {
    background: var(--cyber-card-bg) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--cyber-border) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
}

/* Cyberpunk List Items */
.list-group-item.cyber-item {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
    color: var(--cyber-text-secondary) !important;
    transition: all 0.3s ease !important;
}

.list-group-item.cyber-item:hover {
    background: rgba(0, 255, 255, 0.1) !important;
    border-color: rgba(0, 255, 255, 0.4) !important;
    color: var(--cyber-text-primary) !important;
    transform: translateX(5px) !important;
}

.list-group-item.cyber-item.active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 150, 255, 0.2)) !important;
    border-color: var(--cyber-neon-cyan) !important;
    color: var(--cyber-text-primary) !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3) !important;
}

/* Cyberpunk Scrollbar */
.cyber-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.cyber-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.cyber-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cyber-neon-cyan), var(--cyber-neon-blue));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.cyber-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ffff, #0099ff);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Cyberpunk Progress Bars */
.progress.cyber-progress {
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 10px !important;
    height: 8px !important;
}

.progress-bar.cyber-progress-bar {
    background: linear-gradient(90deg, var(--cyber-neon-cyan), var(--cyber-neon-blue)) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5) !important;
}

/* Cyberpunk Alert/Badge */
.alert.cyber-alert {
    background: var(--cyber-glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    border-radius: 12px !important;
    color: var(--cyber-text-primary) !important;
}

.badge.cyber-badge {
    background: linear-gradient(135deg, var(--cyber-neon-cyan), var(--cyber-neon-blue)) !important;
    color: rgba(0, 0, 0, 0.9) !important;
    font-weight: 600 !important;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.4) !important;
}

/* Cyberpunk Animation Effects */
.cyber-scan-line {
    position: relative;
    overflow: hidden;
}

.cyber-scan-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyber-neon-cyan), transparent);
    animation: scanLine 3s infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile Cyberpunk Optimizations */
@media (max-width: 768px) {
    .cyber-card {
        backdrop-filter: blur(10px) saturate(150%);
        -webkit-backdrop-filter: blur(10px) saturate(150%);
        margin-bottom: 1rem;
    }
    
    .cyber-message-user,
    .cyber-message-ai {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    /* Reduce neon effects on mobile for battery life */
    .cyber-neon-accent {
        animation: none;
        box-shadow: 0 0 5px var(--cyber-neon-cyan) !important;
    }
}

/* ===== INTERACTIVE WIDGET SYSTEM STYLES ===== */

/* Cyberpunk Widget Container */
.cyber-widget-container {
    background: linear-gradient(135deg, var(--cyber-card-bg) 0%, var(--cyber-glass-bg) 100%);
    border: 1px solid var(--cyber-border);
    border-radius: 12px;
    box-shadow: var(--cyber-shadow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
}

.cyber-widget-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--cyber-neon-cyan) 50%, transparent 100%);
    opacity: 0.6;
    animation: cyber-scan 3s infinite;
}

@keyframes cyber-scan {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.cyber-widget-container:hover {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Cyberpunk Button Styles */
.btn-cyber-primary {
    background: linear-gradient(135deg, rgba(var(--cyber-primary-rgb), 0.8) 0%, rgba(var(--cyber-primary-rgb), 0.6) 100%);
    border: 1px solid rgba(var(--cyber-primary-rgb), 0.6);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(var(--cyber-primary-rgb), 0.3);
    transition: all 0.3s ease;
}

.btn-cyber-primary:hover {
    background: linear-gradient(135deg, rgba(var(--cyber-primary-rgb), 1) 0%, rgba(var(--cyber-primary-rgb), 0.8) 100%);
    box-shadow: 0 0 20px rgba(var(--cyber-primary-rgb), 0.5);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-cyber-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.8) 0%, rgba(108, 117, 125, 0.6) 100%);
    border: 1px solid rgba(108, 117, 125, 0.6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.3);
}

.btn-cyber-secondary:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 1) 0%, rgba(108, 117, 125, 0.8) 100%);
    box-shadow: 0 0 15px rgba(108, 117, 125, 0.5);
    color: #ffffff;
}

.btn-cyber-neon {
    background: linear-gradient(135deg, rgba(var(--cyber-neon-rgb), 0.8) 0%, rgba(var(--cyber-neon-rgb), 0.6) 100%);
    border: 1px solid var(--cyber-neon-cyan);
    color: #000000;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(var(--cyber-neon-rgb), 0.4);
    text-shadow: none;
}

.btn-cyber-neon:hover {
    background: linear-gradient(135deg, var(--cyber-neon-cyan) 0%, rgba(var(--cyber-neon-rgb), 0.8) 100%);
    box-shadow: 0 0 30px rgba(var(--cyber-neon-rgb), 0.6);
    color: #000000;
}

/* Timer Widget Specific Styles */
.timer-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cyber-border);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    position: relative;
    overflow: hidden;
}

/* Calculator Widget Specific Styles */
.calculator-buttons .btn {
    border-radius: 8px !important;
    margin: 2px;
    font-weight: 600;
    min-height: 45px;
    transition: all 0.2s ease;
}

.calculator-buttons .btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Counter Widget Specific Styles */
.counter-display {
    background: radial-gradient(circle at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    border: 2px solid var(--cyber-border);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

/* Mobile Widget Optimizations */
@media (max-width: 768px) {
    .cyber-widget-container {
        margin: 0.5rem 0;
        padding: 1rem !important;
    }
    
    .calculator-buttons .btn {
        min-height: 50px;
        font-size: 1.1rem;
    }
    
    .timer-display {
        font-size: 2rem !important;
    }
    
    .counter-display {
        width: 100px;
        height: 100px;
        font-size: 2.5rem !important;
    }
}
