/* Warehouse Sensor Monitoring Dashboard CSS */

/* Menu Sections */
.menu-section {
    margin-bottom: 10px;
}

.menu-header {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.menu-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toggle-icon {
    transition: transform 0.3s;
}

.menu-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.menu-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-content.expanded {
    max-height: 500px;
}

.menu-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 25px;
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid #3b82f6;
}

.menu-icon {
    font-size: 1.2rem;
}

.menu-text {
    flex: 1;
    font-size: 0.9rem;
}

.menu-badge {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.menu-badge.warning {
    background: #f59e0b;
}

.menu-badge.danger {
    background: #ef4444;
}

/* Dashboard Content */
.dashboard-content {
    padding: 20px;
}

/* Sensor Cards Grid */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-width: 1400px;
}

.sensor-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sensor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.sensor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sensor-icon {
    font-size: 2rem;
}

.sensor-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.status-dot.degraded {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.sensor-card-body {
    margin-bottom: 15px;
}

.sensor-id {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.sensor-location {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.sensor-card-footer {
    display: flex;
    gap: 10px;
}

.sensor-metric {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
}

.metric-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 3px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #10b981;
}

/* System Info Content */
.system-info-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
    margin: 20px auto;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    color: #3b82f6;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Digital Twin View */
.digital-twin-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Full Map Layout */
.dashboard-grid-fullmap {
    width: 100%;
}

.warehouse-map-full {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.panel-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.panel-header-inline h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 700;
}

.map-controls {
    display: flex;
    gap: 10px;
}

.btn-control {
    background: #3b82f6;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-control:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.map-canvas-large {
    width: 100%;
    height: 600px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.map-legend-bottom {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.map-legend-bottom .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.twin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.control-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.twin-map {
    width: 100%;
    height: 600px;
    background: #0a0e1a;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.twin-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

/* SVG Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Forklift Tracking */
.forklift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.forklift-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.forklift-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.forklift-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.forklift-icon {
    font-size: 1.8rem;
}

.forklift-id {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4CAF50;
    flex: 1;
}

.status-badge-small {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge-small.online {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.forklift-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

/* Risk Events */
.events-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.event-item {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.event-item.high-risk {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, #1e293b 100%);
}

.event-item.medium-risk {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, #1e293b 100%);
}

.event-item.low-risk {
    border-left-color: #eab308;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1) 0%, #1e293b 100%);
}

.event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.event-icon {
    font-size: 1.2rem;
}

.event-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.event-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.event-body {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.event-action {
    padding: 10px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #60a5fa;
}

/* Voice Commands */
.commands-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.command-item {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.command-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.command-icon {
    font-size: 1.2rem;
}

.command-target {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: #8b5cf6;
}

.command-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.command-body {
    padding: 12px;
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid #8b5cf6;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #ffffff;
    margin-bottom: 10px;
    font-style: italic;
}

.command-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.command-status.delivered {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========================================
   DIGITAL TWIN ANIMATION STYLES
   ======================================== */

.sensor-interactive {
    cursor: pointer;
    transition: all 0.3s ease;
}

.sensor-interactive:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.forklift-animated {
    transition: transform 0.05s linear;
}

/* Scenario Buttons */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: 2px solid rgba(239, 68, 68, 0.3) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: 2px solid rgba(245, 158, 11, 0.3) !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4) !important;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4) !important;
}

/* Animation Keyframes */
@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.dt-label {
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ========================================
   VOICE CONTROL PANEL STYLES
   ======================================== */

.voice-control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px;
}

.voice-input-section,
.voice-history-section {
    display: flex;
    flex-direction: column;
}

.voice-input-card,
.voice-history-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.voice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.voice-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #ffffff;
}

.voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
}

.status-dot.status-ready {
    background: #10b981;
}

.status-dot.status-listening {
    background: #3b82f6;
    animation: pulse 1s infinite;
}

.status-dot.status-error {
    background: #ef4444;
}

.status-text {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 600;
}

.voice-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-voice-start,
.btn-voice-stop {
    flex: 1;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-voice-start {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-voice-start:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-voice-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-voice-stop:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-voice-start:disabled,
.btn-voice-stop:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.voice-transcript-box {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    margin-bottom: 20px;
}

.transcript-placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    text-align: center;
    padding: 50px 20px;
}

.transcript-active {
    color: #3b82f6;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.transcript-final {
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.transcript-interim {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-style: italic;
}

.voice-commands-help {
    margin-top: 20px;
}

.voice-commands-help h4 {
    margin: 0 0 15px 0;
    color: #ffffff;
    font-size: 1.1rem;
}

.command-examples {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.example-item {
    padding: 12px 15px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.example-item:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateX(5px);
}

.voice-history-card h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    color: #ffffff;
}

.command-history {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .voice-control-panel {
        grid-template-columns: 1fr;
    }
}
