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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Canvas Area */
.canvas-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

#warehouseCanvas {
    width: 100%;
    height: 500px;
    display: block;
    background: #16213e;
}

.canvas-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
}

.stats-overlay {
    display: flex;
    gap: 15px;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
}

.stat-box i {
    color: #00b4d8;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn i {
    font-size: 1.1rem;
}

.btn-primary {
    background: #4361ee;
    color: white;
}

.btn-primary:hover {
    background: #3a56d4;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: #f9c74f;
    color: #333;
}

.btn-success {
    background: #4cc9f0;
    color: white;
}

.btn-danger {
    background: #f72585;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Control Panel */
.panel-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.panel-section h3 {
    color: #4361ee;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

input[type="range"] {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #4cc9f0, #4361ee);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #4361ee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
}

.mode-buttons {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.mode-btn.active {
    border-color: #4361ee;
    background: #4361ee;
    color: white;
}

.mode-btn:hover {
    border-color: #4361ee;
}

/* Joystick */
.joystick-container {
    text-align: center;
}

.joystick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.joy-row {
    display: flex;
    gap: 10px;
}

.joy-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    cursor: pointer;
    font-size: 1.5rem;
    color: #4361ee;
    transition: all 0.2s ease;
}

.joy-btn:hover {
    background: #4361ee;
    color: white;
    transform: scale(1.1);
}

.joy-btn:active {
    transform: scale(0.95);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-card i {
    font-size: 2rem;
    color: #4361ee;
    margin-bottom: 10px;
}

.stat-card h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

/* System Log */
.log-container {
    background: white;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

#systemLog {
    height: 200px;
    overflow-y: auto;
    padding: 15px;
    background: #1a1a2e;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 4px solid;
}

.log-entry.info {
    background: rgba(67, 97, 238, 0.1);
    border-left-color: #4361ee;
}

.log-entry.success {
    background: rgba(76, 201, 240, 0.1);
    border-left-color: #4cc9f0;
}

.log-entry.warning {
    background: rgba(249, 199, 79, 0.1);
    border-left-color: #f9c74f;
}

.log-entry.error {
    background: rgba(247, 37, 133, 0.1);
    border-left-color: #f72585;
}

.log-time {
    color: #888;
    margin-right: 10px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.9;
}

footer .version {
    font-size: 0.9rem;
    margin-top: 5px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .controls {
        justify-content: center;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .joy-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
