/* Legacy modal styles - kept for backwards compatibility but not used by new widget */
.modal-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
}

.modal-fullscreen .modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
}

.modal-fullscreen .modal-header {
    border: none !important;
}

.modal-fullscreen .modal-footer {
    border: none !important;
}

.modal-fullscreen .widget-chat-list-group .list-group-item .body {
    font-size: 1.2rem;
}

.soundwave {
    height: 20vh;
}

.glowing-image {
    position: relative;
    display: inline-block;
}

/* Glow effect (Initially disabled) */
.glowing-image::before {
    content: "";
    position: absolute;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    background: radial-gradient(circle, rgba(94, 164, 212, 0.8) 25%, rgba(94, 164, 212, 0) 75%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(25px);
    opacity: 0; /* Initially hidden */
    transform: scale(1);
    transition: opacity 0.7s ease-in-out, transform 0.5s ease-in-out;
    pointer-events: none;
}

/* Add this class to start the glow */
.glowing-image.glow::before {
    opacity: 1;
    animation: glow 0.5s infinite alternate ease-in-out;
}

.glowing-image img {
    display: block;
    width: 100%;
    border-radius: 10px;
    position: relative;
    z-index: 2;
}

@keyframes glow {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0.5;
    }
}

.log-viewer-dark-container {
    background-color: #343a40; /* BS4 dark background */
}

/* Simulator Widget Bubble Styles */
.simulator-widget-bubble {
    position: fixed;
    bottom: 20px;
    right: 100px; /* Position next to chat widget */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4);
    z-index: 1050;
    transition: all 0.3s ease;
    border: 3px solid #2c3e50;
}

.simulator-widget-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.6);
}

.simulator-widget-bubble.has-notification {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(39, 174, 96, 0.8); }
    100% { box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4); }
}

.simulator-widget-bubble .simulator-icon {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.simulator-widget-bubble.simulator-active .simulator-icon {
    transform: rotate(135deg);
}

/* Simulator Widget Panel Styles */
.simulator-widget-panel {
    position: fixed;
    bottom: 90px;
    right: 100px;
    width: 450px;
    max-width: calc(100vw - 40px);
    height: 650px;
    max-height: calc(100vh - 120px);
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    z-index: 1060;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #3498db;
}

.simulator-widget-panel.show {
    display: flex;
    animation: slideUpFuturistic 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.simulator-widget-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #34495e;
}

.simulator-title {
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.simulator-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #27ae60;
    margin-right: 10px;
    animation: blink 2s infinite;
}

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

.simulator-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.simulator-widget-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.simulator-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #2c3e50;
}

.simulator-controls {
    padding: 1rem;
    border-bottom: 1px solid #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #34495e;
}

.simulator-latency {
    color: #3498db;
    font-weight: 600;
    font-size: 0.9rem;
}

.simulator-soundwave-container {
    display: flex;
    align-items: center;
}

.soundwave-mini {
    height: 40px;
    filter: brightness(1.2);
}

.simulator-chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #2c3e50;
}

.simulator-chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.simulator-chat-list .list-group-item {
    background: transparent;
    border: none;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(52, 73, 94, 0.5);
}

.simulator-chat-list .list-group-item:last-child {
    border-bottom: none;
}

.simulator-chat-list .list-group-item .thumb img {
    width: 40px;
    height: 40px;
    border: 2px solid #3498db;
}

.simulator-chat-list .list-group-item .sender {
    color: #3498db;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.simulator-chat-list .list-group-item .body {
    color: #ecf0f1;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.simulator-chat-list .list-group-item .time {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.message-metadata {
    margin-top: 0.5rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(127, 140, 141, 0.2);
}

.message-metadata small {
    color: #95a5a6;
    font-size: 0.75rem;
    display: inline-block;
}

.speech-duration {
    color: #3498db !important;
}

.target-duration {
    color: #e67e22 !important;
}

.timestamp {
    color: #7f8c8d !important;
}

.simulator-action-buttons {
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid #34495e;
    background: #34495e;
}

.simulator-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.simulator-btn:hover {
    transform: scale(1.1);
    border-color: white;
}

.simulator-btn.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.simulator-btn.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.simulator-btn.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

/* Initial button visibility - start button visible, stop button hidden */
#stopSimulationButton {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .simulator-widget-panel {
        right: 20px;
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
    }
    
    .simulator-widget-bubble {
        right: 90px;
    }
}
    color: #f8f9fa; /* BS4 light text */
    padding: 1.5rem;
    border-radius: 0.3rem;
    min-height: 80vh; /* Ensure it takes substantial height */
}

/* Style the inline form controls */
.log-controls-inline {
    margin-bottom: 1rem; /* Space below controls */
    display: flex; /* Use flexbox for alignment */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 1rem; /* Space between controls */
    align-items: flex-end; /* Align items at the bottom */
}

.log-controls-inline .form-group {
    margin-bottom: 0; /* Remove default form-group margin */
}

/* Ensure labels are visible in dark mode */
.log-controls-inline label {
    color: #f8f9fa; /* Light text for labels */
    margin-right: 0.5rem; /* Space between label and select */
    margin-bottom: 0.25rem; /* Space below label */
    font-size: 0.9em;
}

 /* Styling BS4 custom-select for dark mode */
.log-controls-inline .custom-select {
    background-color: #495057; /* Darker background for select */
    color: #f8f9fa; /* Light text */
    border-color: #6c757d; /* Border color */
    height: calc(1.5em + .75rem + 2px); /* BS4 default height */
    padding: .375rem 1.75rem .375rem .75rem;
    font-size: 0.9rem;
    /* Adjust background image for dropdown arrow for dark mode if needed */
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23f8f9fa' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right .75rem center/8px 10px no-repeat;
}
.log-controls-inline .custom-select:focus {
     border-color: #adb5bd;
     box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); /* Focus ring */
}


/* Log Content Area Styling */
.log-content-pre {
    background-color: #212529; /* Slightly different dark for contrast */
    color: #ced4da; /* Default light gray text for logs */
    border: 1px solid #495057;
    padding: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    line-height: 1.5;
    border-radius: 0.25rem; /* BS4 border-radius */
    max-height: 65vh; /* Limit height and make scrollable */
    overflow-y: auto;
}

/* --- Log Line Color Coding (Adjusted for Dark Background BS4) --- */
.log-line {
    display: block;
    margin-bottom: 1px;
    padding: 0px 4px;
    border-radius: 2px;
}

.log-line.faded {
  opacity: 0.3;
}

/* Default / Unknown Level */
.log-unknown {
    color: #6c757d; /* BS4 muted gray */
}

/* Specific Levels - Using specific hex/lighter colors */
.log-debug {
    color: #089dff;
}
.log-info {
    color: #f8f9fa;
}
.log-warning {
    color: #ff8100;
}
.log-error {
    color: #ff4231;
}
.log-critical {
    color: #dc3545;
    font-weight: bold;
    background-color: rgba(220, 53, 69, 0.15);
    /* border: 1px dashed #dc3545; /* Optional border */
}

.sidebar-overlay {
    display: none;
}

/* Mobile navigation */
@media (max-width: 767.98px) {
    body.sidebar-open {
        overflow: hidden;
    }

    #sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 85vw);
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background-color: #0f1d3a;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.45);
        padding-top: 4.5rem;
        padding-bottom: 2rem;
        overflow-y: auto;
        z-index: 1040;
    }

    #sidebar.mobile {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(13, 18, 40, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1035;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .content-wrap {
        left: 0 !important;
        padding-top: 4.5rem;
    }

    main.content {
        min-height: calc(100vh - 4.5rem);
    }
}
