/* ============================================
   CROWDTALE: ANNAVERSE - UI ENHANCEMENTS
   Comprehensive visual improvements for chat_app.html
   ============================================ */

/* ============================================
   1. ENHANCED PANELS & CONTAINERS
   ============================================ */

/* Left Panel - Enhanced with gradient and glow */
.left-panel {
    background: linear-gradient(180deg, 
        rgba(15, 15, 15, 0.98) 0%, 
        rgba(10, 10, 10, 0.95) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 
        2px 0 30px rgba(0, 212, 255, 0.2),
        inset -1px 0 20px rgba(0, 212, 255, 0.05);
    position: relative;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.5) 50%, 
        transparent 100%);
    animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Right Panel - Enhanced */
.right-panel {
    background: linear-gradient(180deg, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(15, 15, 15, 0.98) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 
        -2px 0 30px rgba(0, 212, 255, 0.2),
        inset 1px 0 20px rgba(0, 212, 255, 0.05);
}

/* Panel Sections - Glassmorphism Effect */
.panel-section {
    background: rgba(1, 30, 41, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.panel-section:hover {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Chat View - Enhanced */
.chat-view,
.user-account-view,
.storefront-items-view,
.settings-view,
.store-bundles-view-left {
    background: linear-gradient(135deg, 
        rgba(1, 30, 41, 0.95) 0%, 
        rgba(0, 20, 30, 0.98) 100%);
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 0 30px rgba(0, 212, 255, 0.2),
        inset 0 0 40px rgba(0, 212, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.chat-view::before,
.user-account-view::before,
.settings-view::before,
.store-bundles-view-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   2. ENHANCED ICONS SECTION
   ============================================ */

.panel-icons-section {
    background: linear-gradient(135deg, 
        rgba(1, 30, 41, 0.95) 0%, 
        rgba(0, 20, 30, 0.98) 100%);
    border: 2px solid rgba(0, 212, 255, 0.4);
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.3),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.panel-icons-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 212, 255, 0.1), 
        transparent);
    animation: iconShimmer 4s infinite;
    pointer-events: none;
    z-index: 0;
}

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

.panel-icon {
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: auto;
}

/* Don't override Font Awesome's ::before - it contains the icon */
.panel-icon:hover {
    color: #00d4ff !important;
    text-shadow: 
        0 0 10px rgba(0, 212, 255, 0.8),
        0 0 20px rgba(0, 212, 255, 0.6);
    transform: scale(1.1);
    background: transparent;
}

/* ============================================
   3. ENHANCED CHAT MESSAGES
   ============================================ */

.chat-messages {
    position: relative;
    z-index: 1;
}

/* Message bubbles - Enhanced styling */
.chat-messages .message {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 0;
    backdrop-filter: blur(5px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    min-height: auto;
    height: auto;
    max-height: none;
    box-sizing: border-box;
    white-space: normal;
}

/* Removed .chat-messages .message::before - no left stick */

.chat-messages .message:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.chat-messages .message.user {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
}

.chat-messages .message.system {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   4. ENHANCED INPUT FIELDS
   ============================================ */

.chat-input-wrapper {
    background: rgba(1, 30, 41, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(0, 212, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.chat-input-wrapper:focus-within {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-input-wrapper:focus-within::before {
    left: 100%;
}

.chat-input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1rem;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-icon {
    color: rgba(0, 212, 255, 0.6);
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within .input-icon {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    transform: scale(1.1);
}

/* ============================================
   5. ENHANCED BUTTONS
   ============================================ */

.btn-header {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(240, 240, 240, 0.95) 100%);
    border: 2px solid rgba(0, 212, 255, 0.5);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 0 10px rgba(0, 212, 255, 0.2);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.btn-header:hover {
    background: linear-gradient(135deg, 
        rgba(0, 212, 255, 0.9) 0%, 
        rgba(0, 180, 220, 0.9) 100%);
    color: #ffffff;
    border-color: rgba(0, 212, 255, 0.8);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

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

.btn-header:active {
    transform: translateY(0);
}

/* ============================================
   6. ENHANCED MODALS
   ============================================ */

.modal-content {
    background: linear-gradient(135deg, 
        rgba(1, 30, 41, 0.98) 0%, 
        rgba(0, 20, 30, 0.98) 100%);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 212, 255, 0.3);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.05);
}

.modal-title {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.form-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 
        0 0 0 0.2rem rgba(0, 212, 255, 0.25),
        0 0 15px rgba(0, 212, 255, 0.2);
    color: #ffffff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   7. ENHANCED SIGNAL STABILITY
   ============================================ */

.signal-stability {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    backdrop-filter: blur(5px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

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

.signal-icon {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    animation: signalPulse 2s ease-in-out infinite;
}

@keyframes signalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   8. ENHANCED GEM DISPLAY
   ============================================ */

.gem-container {
    background: linear-gradient(135deg, 
        rgba(0, 212, 255, 0.1) 0%, 
        rgba(0, 212, 255, 0.05) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gem-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(0, 212, 255, 0.1) 0%, 
        transparent 70%);
    animation: gemRotate 4s linear infinite;
}

@keyframes gemRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gem-container:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   9. ENHANCED AUDIO CONTROLS
   ============================================ */

.audio-control-item {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.audio-control-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.audio-slider {
    accent-color: #00d4ff;
}

.audio-slider::-webkit-slider-thumb {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.audio-slider::-moz-range-thumb {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.volume-btn-inline {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.volume-btn-inline:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    transform: scale(1.1);
}

/* Active volume button state - Enhanced */
.volume-btn-active {
    background: rgba(0, 212, 255, 0.25) !important;
    border-color: #00d4ff !important;
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.7),
        inset 0 0 10px rgba(0, 212, 255, 0.2) !important;
    transform: scale(1.05);
}

.volume-btn-active .volume-icon-inline {
    opacity: 1 !important;
    color: #00d4ff !important;
    text-shadow: 0 0 10px rgba(0, 212, 255, 1) !important;
}

.volume-btn-active:hover {
    background: rgba(0, 212, 255, 0.35) !important;
    box-shadow: 
        0 0 25px rgba(0, 212, 255, 0.9),
        inset 0 0 15px rgba(0, 212, 255, 0.3) !important;
    transform: scale(1.1);
}

/* ============================================
   10. ENHANCED SCROLLBARS
   ============================================ */

.chat-view::-webkit-scrollbar,
.user-account-view::-webkit-scrollbar,
.storefront-items-view::-webkit-scrollbar,
.settings-view::-webkit-scrollbar {
    width: 8px;
}

.chat-view::-webkit-scrollbar-track,
.user-account-view::-webkit-scrollbar-track,
.storefront-items-view::-webkit-scrollbar-track,
.settings-view::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-view::-webkit-scrollbar-thumb,
.user-account-view::-webkit-scrollbar-thumb,
.storefront-items-view::-webkit-scrollbar-thumb,
.settings-view::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.6) 0%, 
        rgba(0, 212, 255, 0.4) 100%);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.chat-view::-webkit-scrollbar-thumb:hover,
.user-account-view::-webkit-scrollbar-thumb:hover,
.storefront-items-view::-webkit-scrollbar-thumb:hover,
.settings-view::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.8) 0%, 
        rgba(0, 212, 255, 0.6) 100%);
}

/* ============================================
   11. ENHANCED NOTIFICATIONS
   ============================================ */

#notification-container .notification {
    background: linear-gradient(135deg, 
        rgba(1, 30, 41, 0.95) 0%, 
        rgba(0, 20, 30, 0.95) 100%);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 212, 255, 0.3);
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   12. ENHANCED FOOTER
   ============================================ */

.footer {
    background: linear-gradient(135deg, 
        rgba(1, 30, 41, 0.95) 0%, 
        rgba(0, 20, 30, 0.98) 100%);
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.5) 50%, 
        transparent 100%);
    animation: footerGlow 2s ease-in-out infinite;
}

@keyframes footerGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    letter-spacing: 1px;
}

/* ============================================
   13. ENHANCED GAME FRAME
   ============================================ */

.game-frame {
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.3),
        inset 0 0 40px rgba(0, 212, 255, 0.1);
    position: relative;
}

.game-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid;
    border-image: linear-gradient(135deg, 
        rgba(0, 212, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(0, 212, 255, 0.6) 100%) 1;
    border-radius: 4px;
    pointer-events: none;
    animation: frameGlow 3s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes frameGlow {
    0% {
        opacity: 0.4;
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    100% {
        opacity: 0.8;
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

/* ============================================
   14. ENHANCED ACHIEVEMENTS & STATS
   ============================================ */

.achievement-card,
.stat-line {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.achievement-card:hover,
.stat-line:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    transform: translateX(5px);
}

/* ============================================
   15. SMOOTH TRANSITIONS FOR ALL ELEMENTS
   ============================================ */

* {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease,
                transform 0.3s ease;
}

/* ============================================
   16. ENHANCED DROPDOWN OPTIONS
   ============================================ */

/* Enhanced dropdown option styling for better visibility */
.settings-dropdown option {
    background: linear-gradient(135deg, 
        rgba(50, 76, 105, 0.98) 0%, 
        rgba(40, 60, 85, 0.98) 100%) !important;
    color: #ffffff !important;
    padding: 12px 15px !important;
    border: none !important;
    font-size: 0.95rem !important;
    font-family: 'Tomorrow', sans-serif !important;
}

.settings-dropdown option:hover {
    background: linear-gradient(135deg, 
        rgba(60, 90, 120, 0.98) 0%, 
        rgba(50, 75, 100, 0.98) 100%) !important;
    color: #00d4ff !important;
}

.settings-dropdown option:checked,
.settings-dropdown option:focus {
    background: linear-gradient(135deg, 
        rgba(0, 212, 255, 0.2) 0%, 
        rgba(60, 90, 120, 0.95) 100%) !important;
    color: #00d4ff !important;
    font-weight: 600 !important;
}

/* Ensure dropdown background matches theme */
.settings-dropdown {
    background-color: rgba(50, 76, 105, 0.8) !important;
}

.settings-dropdown::-ms-expand {
    background-color: rgba(50, 76, 105, 0.8);
    color: #00d4ff;
}

/* ============================================
   17. RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    .left-panel,
    .right-panel {
        box-shadow: none;
    }
    
    .panel-section {
        padding: 10px;
    }
    
    .title-section .header-title {
        font-size: 1.5rem;
    }
    
    /* Reduce glow effects on mobile for performance */
    .panel-icons-section::before,
    .chat-view::before,
    .user-account-view::before,
    .settings-view::before {
        animation-duration: 5s;
    }
    
    /* Optimize shadows for mobile */
    .bundle-card,
    .achievement-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    .left-panel,
    .right-panel {
        box-shadow: none;
    }
    
    .panel-section {
        padding: 8px;
    }
    
    .title-section .header-title {
        font-size: 1.3rem;
    }
    
    /* Reduce animations for better performance */
    .bundle-card:hover,
    .achievement-card:hover {
        transform: translateY(-2px);
    }
    
    /* Simplify gradients on small screens */
    .chat-view,
    .user-account-view,
    .settings-view {
        background: rgba(1, 30, 41, 0.98);
    }
}

/* Very small phones (360px and below) */
@media (max-width: 360px) {
    .title-section .header-title {
        font-size: 1.1rem;
    }
    
    /* Minimal animations on very small screens */
    .bundle-card,
    .achievement-card {
        transition: opacity 0.2s ease;
    }
    
    .bundle-card:hover,
    .achievement-card:hover {
        transform: none;
        opacity: 0.9;
    }
}

/* Landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .title-section {
        padding: 8px 15px;
    }
    
    .title-section .header-title {
        font-size: 1.2rem;
    }
}
