@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Roboto+Mono:wght@300;400&display=swap');

:root {
    --primary-color: #00A3FF;
    --primary-glow: rgba(0, 163, 255, 0.5);
    --secondary-color: #7B42F6;
    --accent-color: #FF4081;
    --dark-bg: #0A0E17;
    --darker-bg: #060911;
    --panel-bg: rgba(15, 23, 42, 0.7);
    --text-color: #E2E8F0;
    --text-secondary: #94A3B8;
    --success-color: #00E676;
    --warning-color: #FFAB00;
    --error-color: #FF5252;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Roboto Mono', monospace;
    background-color: var(--darker-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 20% 35%, rgba(123, 66, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 10%, rgba(0, 163, 255, 0.1) 0%, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    max-height: 100vh;
}

.assistant-container {
    width: 100%;
    max-width: 900px;
    background-color: var(--dark-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 163, 255, 0.2),
                0 0 80px rgba(123, 66, 246, 0.1);
    border: 1px solid rgba(123, 66, 246, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
}

.assistant-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 163, 255, 0.05) 0%, rgba(123, 66, 246, 0.05) 100%);
    pointer-events: none;
}

/* Header */
.assistant-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(10, 14, 23, 0.8);
}

.assistant-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    position: relative;
}

.assistant-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

.status-indicator {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success-color);
    margin-right: 8px;
    box-shadow: 0 0 10px var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(0.95);
    }
}

/* Visualization Container */
.visualization-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    position: relative;
}

.audio-visualizer {
    position: relative;
    width: 8rem;
    height: 8rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.visualizer-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.outer-ring {
    width: 200px;
    height: 200px;
    border-color: rgba(0, 163, 255, 0.4);
    animation: rotate 10s linear infinite;
}

.middle-ring {
    width: 150px;
    height: 150px;
    border-color: rgba(123, 66, 246, 0.4);
    animation: rotate 8s linear infinite reverse;
}

.inner-ring {
    width: 100px;
    height: 100px;
    border-color: rgba(255, 64, 129, 0.4);
    animation: rotate 6s linear infinite;
}

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

.center-button {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: all 0.3s ease;
}

.center-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--primary-glow);
}

.center-button i {
    font-size: 1rem;
    color: white;
}

.center-button.listening {
    animation: pulse-recording 1.5s infinite;
    background: radial-gradient(circle, var(--error-color) 0%, var(--accent-color) 100%);
}

@keyframes pulse-recording {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 64, 129, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 64, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 64, 129, 0);
    }
}

/* Conversation Display */
.conversation-display {
    display: flex;
    padding: 20px;
    background-color: var(--panel-bg);
    border-radius: 10px;
    margin: 0 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.transcript-container {
    flex: 3;
    margin-right: 20px;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.conversation-history {
    height: 250px;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.conversation-history::-webkit-scrollbar {
    width: 5px;
}

.conversation-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.conversation-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    position: relative;
    max-width: 85%;
}

.user-message {
    background-color: rgba(0, 163, 255, 0.15);
    align-self: flex-end;
    margin-left: auto;
    border-left: 3px solid var(--primary-color);
}

.assistant-message {
    background-color: rgba(123, 66, 246, 0.15);
    align-self: flex-start;
    border-left: 3px solid var(--secondary-color);
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    position: absolute;
    right: 10px;
    bottom: 5px;
}

.system-metrics {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric {
    background-color: rgba(10, 14, 23, 0.6);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-family: 'Orbitron', sans-serif;
}

.metric-value {
    font-size: 1rem;
    font-weight: 500;
}

/* Control Panel */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--darker-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.control-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.volume-control {
    display: flex;
    align-items: center;
    width: 200px;
}

.volume-control i {
    color: var(--text-secondary);
    margin: 0 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(6, 9, 17, 0.9);
    overflow: auto;
}

.modal-content {
    background-color: var(--dark-bg);
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 163, 255, 0.3);
    border: 1px solid rgba(123, 66, 246, 0.3);
    animation: modalFadeIn 0.3s;
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.close {
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.setting-group select,
.setting-group input[type="range"] {
    width: 100%;
    padding: 8px 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
}

.setting-group select {
    cursor: pointer;
    outline: none;
}

.setting-group select option {
    background-color: var(--dark-bg);
}

#listenTimeValue {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    color: var(--primary-color);
}

.modal-footer {
    padding: 15px 20px;
    text-align: right;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#saveSettings {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    transition: all 0.2s ease;
}

#saveSettings:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 163, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .conversation-display {
        flex-direction: column;
    }
    
    .transcript-container {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .system-metrics {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .metric {
        flex: 1;
        min-width: 100px;
    }
    
    .volume-control {
        width: 150px;
    }
}

@media (max-width: 576px) {
    .assistant-container {
        border-radius: 0;
        height: 100vh;
    }
    
    .container {
        padding: 0;
    }
    
    .system-metrics {
        flex-direction: column;
    }
    
    .audio-visualizer {
        width: 180px;
        height: 180px;
    }
    
    .outer-ring {
        width: 180px;
        height: 180px;
    }
    
    .middle-ring {
        width: 130px;
        height: 130px;
    }
    
    .inner-ring {
        width: 90px;
        height: 90px;
    }
}

/* Audio Wave Animation */
.audio-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-wave.active {
    opacity: 1;
}

.wave {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(0, 163, 255, 0.3);
    animation: wave 3s infinite linear;
}

.wave:nth-child(1) {
    width: 100%;
    height: 100%;
    animation-delay: 0s;
    border-color: rgba(0, 163, 255, 0.3);
}

.wave:nth-child(2) {
    width: 85%;
    height: 85%;
    animation-delay: 0.3s;
    border-color: rgba(123, 66, 246, 0.3);
}

.wave:nth-child(3) {
    width: 70%;
    height: 70%;
    animation-delay: 0.6s;
    border-color: rgba(255, 64, 129, 0.3);
}

.wave:nth-child(4) {
    width: 55%;
    height: 55%;
    animation-delay: 0.9s;
    border-color: rgba(0, 230, 118, 0.3);
}

@keyframes wave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
    margin-left: 10px;
}

.loading div {
    position: absolute;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading div:nth-child(1) {
    left: 2px;
    animation: loading1 0.6s infinite;
}

.loading div:nth-child(2) {
    left: 2px;
    animation: loading2 0.6s infinite;
}

.loading div:nth-child(3) {
    left: 8px;
    animation: loading2 0.6s infinite;
}

.loading div:nth-child(4) {
    left: 14px;
    animation: loading3 0.6s infinite;
}

@keyframes loading1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(6px, 0);
    }
}

/* Futuristic typing effect */
.typing {
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

/* Holographic effect */
.holographic {
    position: relative;
    overflow: hidden;
}

.holographic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 30%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 50%
    );
    transform: rotate(45deg);
    animation: holographic 3s linear infinite;
    pointer-events: none;
}

@keyframes holographic {
    0% {
        transform: rotate(45deg) translateY(-100%);
    }
    100% {
        transform: rotate(45deg) translateY(100%);
    }
}
