/* ===== SIDE MENU ===== */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 147, 41, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease;
    overflow-y: auto;
}

body.menu-open .side-menu {
    left: 0;
}

body.menu-open #app {
    transform: translateX(280px);
    transition: transform 0.3s ease;
}

#app {
    transition: transform 0.3s ease;
}

.side-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.side-menu-header .menu-logo {
    width: 40px;
    height: 40px;
}

.side-menu-header h2 {
    font-size: 1.2rem;
    color: var(--accent-orange);
    margin: 0;
    font-weight: 600;
}

.menu-section {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.menu-section h3 {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px;
    margin: 0 0 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.menu-item:hover {
    background: rgba(255, 147, 41, 0.1);
}

.menu-item span {
    font-size: 1.1rem;
}

/* Recent Projects */
.recent-projects {
    display: flex;
    flex-direction: column;
}

.recent-project-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.recent-project-item:hover {
    background: rgba(255, 147, 41, 0.08);
}

.project-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.project-summary {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.menu-footer .version {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== CIRCUIT BOARD ANIMATION ===== */
.circuit-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.menu-open .circuit-layer {
    opacity: 0.3;
}

.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
    height: 1px;
    animation: circuitFlow 3s linear infinite;
}

.circuit-line:nth-child(1) {
    top: 20%;
    left: -100%;
    width: 50%;
    animation-delay: 0s;
}

.circuit-line:nth-child(2) {
    top: 50%;
    left: -100%;
    width: 70%;
    animation-delay: 1s;
}

.circuit-line:nth-child(3) {
    top: 80%;
    left: -100%;
    width: 40%;
    animation-delay: 2s;
}

@keyframes circuitFlow {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateX(400%);
        opacity: 0;
    }
}

.circuit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-orange);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-orange);
    animation: circuitPulse 2s ease-in-out infinite;
}

.circuit-dot:nth-child(4) {
    top: 20%;
    right: 30px;
    animation-delay: 0.5s;
}

.circuit-dot:nth-child(5) {
    top: 50%;
    right: 60px;
    animation-delay: 1s;
}

.circuit-dot:nth-child(6) {
    top: 80%;
    right: 20px;
    animation-delay: 1.5s;
}

@keyframes circuitPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* ===== SKEWED MENU ON OPEN ===== */
body.menu-open .side-menu {
    left: 0;
    transform: perspective(1000px) rotateY(0deg);
}

.side-menu {
    transform-origin: left center;
    transform: perspective(1000px) rotateY(-5deg);
}

body.menu-open #app {
    transform: translateX(280px) skewX(-1deg);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#app {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== DEV MODE TOGGLE ===== */
.mode-toggle-section {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
    background: rgba(255, 147, 41, 0.1);
}

.toggle-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.toggle-label.simple {
    color: var(--accent-orange);
}

body.dev-mode .toggle-label.simple {
    color: var(--text-muted);
}

body.dev-mode .toggle-label.dev {
    color: var(--accent-orange);
}

.toggle-track {
    width: 36px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

body.dev-mode .toggle-track {
    background: rgba(255, 147, 41, 0.3);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--accent-orange);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

body.dev-mode .toggle-thumb {
    transform: translateX(18px);
}

/* ===== DEV SECTION STYLING ===== */
.dev-section {
    animation: slideIn 0.25s ease-out;
}

.dev-item {
    border-left: 2px solid var(--accent-orange);
    margin-left: 10px;
}

/* ===== TUNING CONTROLS ===== */
.tuning-group {
    padding: 8px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tuning-group label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.menu-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.menu-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-orange);
    border-radius: 50%;
    cursor: pointer;
}

.menu-input,
.menu-select,
.menu-textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    padding: 6px 10px;
}

.menu-textarea {
    resize: vertical;
    min-height: 60px;
}

/* ===== LANGUAGE TAGS ===== */
.tag-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tag:hover {
    background: rgba(255, 147, 41, 0.1);
}

.tag.active {
    background: rgba(255, 147, 41, 0.15);
    border-color: rgba(255, 147, 41, 0.3);
    color: var(--accent-orange);
}

/* ===== ENHANCED PROJECT ITEMS ===== */
.recent-project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.recent-project-item:hover {
    background: rgba(255, 147, 41, 0.08);
}

.recent-project-item .project-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.recent-project-item .project-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.project-summary {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.track-info-display {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 150px;
    overflow: hidden;
}

.track-icon {
    font-size: 10px;
    opacity: 0.5;
}

.track-text {
    font-family: monospace;
    font-size: 9px;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-buttons {
    display: flex;
    gap: 1px;
    align-items: center;
}

.media-btn {
    background: transparent;
    border: none;
    color: #555;
    padding: 2px 4px;
    font-size: 9px;
    cursor: pointer;
    transition: color 0.15s ease;
    opacity: 0.9;
    /* Increased opacity */
}

.media-btn:hover {
    color: #ff9329;
    opacity: 1;
}

.tuner-toggle {
    position: relative;
    margin-left: 4px;
}

.tuner-btn {
    background: transparent;
    border: none;
    color: #444;
    padding: 2px 6px;
    font-size: 9px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.tuner-btn:hover {
    opacity: 1;
}

.model-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 147, 41, 0.3);
    border-radius: 6px;
    color: #ff9329;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding: 8px 12px;
    margin-left: 8px;
    min-width: 160px;
    transition: all 0.2s ease;
}

.model-select:hover {
    border-color: #ff9329;
    background: rgba(255, 147, 41, 0.1);
}

.model-select:focus {
    border-color: #ff9329;
    box-shadow: 0 0 0 2px rgba(255, 147, 41, 0.2);
}

.model-select option {
    background: #1a1a1a;
    color: #ddd;
    padding: 8px;
}

.systems-btn {
    background: transparent;
    border: none;
    color: #444;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.systems-btn:hover {
    opacity: 1;
}

.toolbar-time {
    font-family: monospace;
    font-size: 10px;
    color: #444;
}

.tuner-display {
    font-family: monospace;
    font-size: 10px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
}

.voice-tuner {
    display: flex;
    gap: 10px;
    padding: 5px;
}

.tuner-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tuner-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 16px;
    height: 50px;
    background: transparent;
    cursor: pointer;
    opacity: 0.7;
}

.tuner-slider input[type="range"]:hover {
    opacity: 1;
}

.tuner-slider span {
    font-size: 8px;
    color: #555;
    font-family: monospace;
    text-transform: uppercase;
}

.toolbar-divider {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.03);
    margin: 0 2px;
}

/* Tuner Popup */
#voice-tuner-popup {
    display: none;
    flex-direction: row;
    position: absolute;
    top: 32px;
    left: -40px;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 8px;
    border-radius: 6px;
    gap: 8px;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

#voice-tuner-popup .tuner-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#voice-tuner-popup .tuner-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 14px;
    height: 40px;
    background: transparent;
    cursor: pointer;
    opacity: 0.6;
}

#voice-tuner-popup .tuner-slider input[type="range"]:hover {
    opacity: 1;
}

#voice-tuner-popup .tuner-slider span {
    font-size: 7px;
    color: #444;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Systems Menu Dropdown */
.systems-menu {
    position: relative;
}

.systems-menu .panel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #555;
    padding: 3px 8px;
    font-size: 9px;
    border-radius: 3px;
}

.systems-menu .panel-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #888;
}

#service-indicators.hidden {
    display: none !important;
}

#service-indicators {
    display: none;
    position: absolute;
    top: 32px;
    right: 0;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px;
    border-radius: 6px;
    flex-direction: column;
    gap: 2px;
    z-index: 2000;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

#service-indicators .service-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s ease;
}

#service-indicators .service-indicator:hover {
    background: rgba(255, 255, 255, 0.04);
}

#service-indicators .indicator-icon {
    font-size: 11px;
    opacity: 0.7;
}

#service-indicators .indicator-label {
    font-size: 9px;
    color: #666;
    font-family: monospace;
}

#service-indicators .service-indicator.online .indicator-label {
    color: #4a4;
}

#service-indicators .service-indicator.offline .indicator-label {
    color: #a44;
}

/* Model Switcher */
.model-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 0;
}

.model-switcher select {
    background: transparent;
    border: none;
    color: #888;
    font-family: monospace;
    font-size: 10px;
    outline: none;
    cursor: pointer;
    padding: 4px;
}

.model-switcher select option {
    background: #2d2d2d;
    color: #f5f5f5;
}

.model-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 147, 41, 0.15);
    color: #ff9329;
    font-weight: 500;
}

/* Service Indicators */
/* Service Status Indicators */
.service-indicators {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    background: transparent;
}

.service-indicator:hover {
    background: rgba(255, 255, 255, 0.05);
}

.indicator-icon {
    font-size: 12px;
}

.indicator-label {
    font-size: 10px;
    color: #888;
    font-family: monospace;
}

.indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b4a;
    flex-shrink: 0;
}

.service-indicator .indicator-dot {
    background: #ff4a4a;
    box-shadow: 0 0 4px rgba(255, 74, 74, 0.4);
}

.service-indicator.online .indicator-dot {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.service-indicator.checking .indicator-dot {
    background: #ffa500;
    box-shadow: 0 0 4px rgba(255, 165, 0, 0.5);
    animation: statusPulse 1s infinite;
}

.indicator-label {
    font-size: 11px;
    color: rgba(245, 245, 245, 0.7);
    font-weight: 500;
}

/* Voice Status */
.voice-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 147, 41, 0.08);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 147, 41, 0.2);
    backdrop-filter: blur(20px);
}

.voice-status.listening {
    background: rgba(255, 147, 41, 0.15);
    border-color: rgba(255, 147, 41, 0.4);
}

.voice-status.processing {
    background: rgba(128, 128, 128, 0.15);
    border-color: rgba(128, 128, 128, 0.4);
}

.voice-status.speaking {
    background: rgba(255, 147, 41, 0.2);
    border-color: rgba(255, 147, 41, 0.5);
}

.voice-icon {
    font-size: 16px;
}

.voice-text {
    font-size: 13px;
    font-weight: 500;
}

/* ===== HISTORY SECTION ===== */
.history-section h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clear-history-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    margin-right: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.clear-history-btn:hover {
    background: rgba(255, 100, 100, 0.15);
    color: #ff6b6b;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 4px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.history-item:hover {
    background: rgba(255, 147, 41, 0.08);
    border-color: rgba(255, 147, 41, 0.15);
}

.history-item .history-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.history-item .history-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item .history-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.history-item .history-text {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    padding: 16px 16px !important;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 4px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: rgba(255, 147, 41, 0.1);
    border-color: rgba(255, 147, 41, 0.3);
    transform: translateY(-2px);
}

.quick-action-btn .action-icon {
    font-size: 1.2rem;
    color: var(--accent-orange);
}

.quick-action-btn .action-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ===== ENHANCED MENU FOOTER ===== */
.menu-footer {
    margin-top: auto;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
}

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

.user-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 147, 41, 0.15);
    border-radius: 50%;
    font-size: 14px;
}

.user-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.menu-footer .version {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Settings Link in Side Menu */
.menu-settings {
    padding: 8px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.settings-link:hover {
    background: rgba(255, 147, 41, 0.1);
    color: var(--accent-orange);
}

.settings-link .workspace-icon {
    font-size: 1.1rem;
}

.settings-link .workspace-label {
    font-size: 0.85rem;
    font-weight: 500;
}