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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: #171923;
    color: white;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    height: 45px;
    width: auto;
}

.header-separator {
    width: 1px;
    height: 35px;
    background-color: #4a5568;
}

.header-title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.7rem;
    color: #a0aec0;
    letter-spacing: 1px;
    line-height: 1.2;
    text-transform: uppercase;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    background: #2d3748;
    border-radius: 20px;
    border: 1px solid #4a5568;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    transition: background 0.3s;
}

.status-dot.connected {
    background: #2ecc71;
    animation: pulse 2s infinite;
}

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

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.zones-sidebar {
    width: 260px;
    background: #1e2430;
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e2e8f0;
}

.sidebar-header {
    padding: 1.2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.sidebar-header h2 {
    font-size: 0.85rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.btn-icon {
    background: rgba(255, 0, 0, 0.1);
    border: none;
    font-size: 0.9rem;
    color: #fc4e4e;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 0, 0, 0.2);
}

.zones-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 1rem 1rem;
}

.zone-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #cbd5e0;
}

.zone-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.zone-item.active {
    background: #ff1c1c;
    color: white;
}

.zone-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zone-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a5568;
}

.zone-item.active .zone-dot {
    background: white;
}

.zone-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zone-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #cbd5e0;
}

.zone-item.active .zone-count {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.zone-name {
    font-weight: 500;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fdfdfd;
    position: relative;
}

.watermark-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.watermark {
    opacity: 0.1;
    max-width: 60%;
    height: auto;
}

.zone-details, .welcome-screen {
    position: relative;
    z-index: 1;
}

.welcome-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #95a5a6;
    text-align: center;
}

.welcome-screen i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.welcome-screen h2 {
    margin-bottom: 0.5rem;
}

.zone-details {
    height: 100%;
}

.zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.zone-header h2 {
    font-size: 1.8rem;
    color: #1a202c;
    font-weight: 700;
}

.zone-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: #ff1c1c;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #e61919;
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f7fafc;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
}

.robots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.robot-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.robot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.robot-name {
    font-weight: 600;
    color: #333;
}

.robot-status {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    background: #f0f0f0;
}

.robot-status.RUNNING {
    background: #2ecc71;
    color: white;
}

.robot-status.IDLE {
    background: #95a5a6;
    color: white;
}

.robot-status.ERROR {
    background: #e74c3c;
    color: white;
}

.robot-details {
    margin-bottom: 1rem;
}

.robot-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.robot-detail-label {
    color: #7f8c8d;
}

.robot-detail-value {
    font-weight: 500;
}

.robot-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.robot-action-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    background: #f1f3f5;
    color: #4a5568;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.robot-action-btn:hover {
    background: #e2e8f0;
}

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

.robot-action-btn.start {
    background: #e8f5e9;
    color: #4caf50;
}

.robot-action-btn.start:hover {
    background: #c8e6c9;
}

.robot-action-btn.stop {
    background: #ffebee;
    color: #f44336;
}

.robot-action-btn.stop:hover {
    background: #ffcdd2;
}

.robot-action-btn.info {
    background: #e3f2fd;
    color: #2196f3;
}

.robot-action-btn.info:hover {
    background: #bbdefb;
}

.robot-action-btn.schedule {
    background: #fff3e0;
    color: #ff9800;
}

.robot-action-btn.schedule:hover {
    background: #ffe0b2;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s;
}

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

.map-modal .modal-content {
    max-width: 800px;
}

.close {
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-text {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.hidden {
    display: none !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2ecc71;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s;
    z-index: 2000;
}

.toast.error {
    background: #e74c3c;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Map Styles */
#map {
    border-radius: 4px;
    margin-bottom: 1rem;
}

.robot-info {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.robot-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

/* No Data Styles */
.no-robots {
    text-align: center;
    padding: 2rem;
    color: #95a5a6;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .zones-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .zone-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .zone-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-primary, .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    .robots-grid {
        grid-template-columns: 1fr;
    }

    .robot-actions {
        flex-wrap: wrap;
    }

    .robot-action-btn {
        min-width: calc(50% - 0.25rem);
    }

    .modal-content {
        margin: 1rem;
        width: auto;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* Utility Classes */
.text-success { color: #2ecc71; }
.text-danger { color: #e74c3c; }
.text-warning { color: #f39c12; }
.text-info { color: #3498db; }

.battery-high { color: #2ecc71; }
.battery-medium { color: #f39c12; }
.battery-low { color: #e74c3c; }