/* Monitoring Dashboard Styles - Scoped to avoid conflicts */
:root {
    --color-primary: #FF6B6B;
    --color-primary-dark: #E85555;
    --color-secondary: #4ECDC4;
    --color-success: #51CF66;
    --color-warning: #FFB84D;
    --color-danger: #FF6B6B;
    
    --color-bg: #0F1419;
    --color-surface: #1A1F2E;
    --color-surface-light: #222938;
    --color-border: #2D3748;
    
    --color-text: #F7FAFC;
    --color-text-secondary: #A0AEC0;
    --color-text-muted: #718096;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.monitoring-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-text);
    padding-bottom: 3rem; /* Add spacing before footer */
}

.monitoring-wrapper * {
    box-sizing: border-box;
}

.monitoring-wrapper .monitoring-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0;
}

/* Header Styles */
.monitoring-wrapper .monitoring-header {
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.5rem; /* Reduced from 1.5rem 2rem */
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.monitoring-wrapper .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.monitoring-wrapper .brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.monitoring-wrapper .brand-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.monitoring-wrapper .brand-title {
    font-size: 1.25rem; /* Reduced from 1.5rem */
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, #FFB84D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.monitoring-wrapper .brand-subtitle {
    font-size: 0.75rem; /* Reduced from 0.875rem */
    color: var(--color-text-secondary);
    font-weight: 400;
}

.monitoring-wrapper .header-stats {
    display: flex;
    gap: 1.5rem;
}

.monitoring-wrapper .stat-card {
    padding: 0.5rem 1rem; /* Reduced from 1rem 1.5rem */
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    min-width: 80px; /* Reduced from 100px */
    text-align: center;
    transition: var(--transition);
}

.monitoring-wrapper .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.monitoring-wrapper .stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.monitoring-wrapper .stat-value {
    font-size: 1.5rem; /* Reduced from 2rem */
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, #FFB84D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Main Content */
.monitoring-wrapper .main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem; /* Reduced from 2rem */
    padding: 1.5rem; /* Reduced from 2rem */
    min-height: calc(100vh - 120px);
}

/* Floor Plan Section */
.floor-plan-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.floor-selector {
    display: flex;
    gap: 0;
    background: var(--color-surface-light);
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.floor-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.floor-tab:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-text);
}

.floor-tab.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF8E53 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.floor-plan-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--color-surface-light);
    /* min-height: 600px; Force minimum height */
}

.floor-plan {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.floor-plan.active {
    opacity: 1;
    visibility: visible;
}

.plan-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Reduced from 2rem */
}

.floor-image {
    width: 95%; /* Increased from max-width 100% */
    height: auto;
    max-height: 95%; /* Increased */
    object-fit: contain;
    border-radius: var(--radius-md);
    filter: brightness(0.9) contrast(1.1);
}

/* Table Markers */
.table-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.table-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 20;
}

.marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

.marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 4px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

/* Status Colors */
.table-marker.available .marker-dot {
    background: var(--color-success);
    border-color: #40C057;
}

.table-marker.occupied .marker-dot {
    background: var(--color-danger);
    border-color: #E85555;
}

.table-marker.reserved .marker-dot {
    background: var(--color-warning);
    border-color: #FFA94D;
}

/* Tenant Zone Labels */
.tenant-label {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
}

.tenant-label-text {
    background: rgba(255, 107, 107, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--color-text);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}


/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--color-surface-light);
    border-top: 1px solid var(--color-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.legend-dot.available {
    background: var(--color-success);
}

.legend-dot.occupied {
    background: var(--color-danger);
}

.legend-dot.reserved {
    background: var(--color-warning);
}

/* Legend Info Panel */
.legend-info-panel {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.legend-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--color-surface-light);
    border-bottom: 1px solid var(--color-border);
}

.legend-info-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0;
}

.legend-info-floor {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    background: rgba(255, 107, 107, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.legend-info-table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0; /* Remove padding from wrapper */
    background: var(--color-surface);
}

.legend-info-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
}

.legend-info-table thead {
    position: sticky;
    top: 0;
    background: var(--color-surface) !important;
    z-index: 10;
}

.legend-info-table thead tr {
    background: var(--color-surface) !important;
}

.legend-info-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-surface) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.legend-info-table tbody {
    display: none;
}

.legend-info-table tbody.active {
    display: table-row-group;
}

.legend-info-table tbody tr {
    transition: var(--transition);
    animation: fadeInRow 0.3s ease;
}

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

.legend-info-table tbody tr:hover {
    background: var(--color-surface-light);
}

.legend-info-table tbody tr:first-child td {
    padding-top: 1.5rem; /* Add top padding to first row */
}

.legend-info-table tbody tr:last-child td {
    padding-bottom: 1.5rem; /* Add bottom padding to last row */
}

.legend-info-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.floor-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF8E53 100%);
    color: white;
    text-align: center;
    min-width: 40px;
}

.code-cell {
    font-weight: 600;
    color: var(--color-text);
    font-family: 'Courier New', monospace;
}

.tenant-cell {
    color: var(--color-text-secondary);
}

/* Scrollbar for legend info table */
.legend-info-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.legend-info-table-wrapper::-webkit-scrollbar-track {
    background: var(--color-surface-light);
}

.legend-info-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.legend-info-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}


/* Activity Log Section */
.activity-log-section {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 500px; /* Limit height so it doesn't expand too much */
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.log-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.refresh-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.log-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border);
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.log-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.log-icon.available {
    background: rgba(81, 207, 102, 0.2);
    color: var(--color-success);
}

.log-icon.occupied {
    background: rgba(255, 107, 107, 0.2);
    color: var(--color-danger);
}

.log-icon.reserved {
    background: rgba(255, 184, 77, 0.2);
    color: var(--color-warning);
}

.log-details {
    flex: 1;
}

.log-table {
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.log-action {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.log-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fafafa;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--color-danger);
    color: white;
}

.modal-body {
    padding: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.detail-value {
    font-weight: 600;
    color: var(--color-text);
}

.status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.available {
    background: rgba(81, 207, 102, 0.2);
    color: var(--color-success);
}

.status-badge.occupied {
    background: rgba(255, 107, 107, 0.2);
    color: var(--color-danger);
}

.status-badge.reserved {
    background: rgba(255, 184, 77, 0.2);
    color: var(--color-warning);
}

/* Scrollbar */
.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.log-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .activity-log-section {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-content {
        padding: 1rem;
        gap: 1rem;
    }
}
