/* Alarms Management Styles */

/* Header Filters - Same as Cases */
.alarms-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.alarms-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.alarms-filter-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(35%) sepia(8%) saturate(1090%) hue-rotate(169deg) brightness(93%) contrast(86%);
}

/* Date Range Filter Styles */
.date-range-filter {
    min-width: 280px;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alarms-date-filter {
    padding: 6px 10px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #2c3e50;
    background: white;
    transition: border-color 0.3s ease;
    min-width: 120px;
}

.alarms-date-filter:focus {
    outline: none;
    border-color: #81C344;
    box-shadow: 0 0 0 2px rgba(129, 195, 68, 0.1);
}

.date-separator {
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.9rem;
}

.alarms-branch-filter {
    padding: 6px 10px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #2c3e50;
    background: white;
    transition: border-color 0.3s ease;
    cursor: pointer;
    min-width: 120px;
}

.alarms-branch-filter:focus {
    outline: none;
    border-color: #81C344;
    box-shadow: 0 0 0 2px rgba(129, 195, 68, 0.1);
}

.alarms-branch-filter option {
    padding: 8px 12px;
    color: #2c3e50;
    background: white;
}

/* Event Alerts Cards */
.event-alerts-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.alert-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 16px;
}

.alert-card.camera-offline {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08), rgba(220, 53, 69, 0.04));
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-card.network-disconnected {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(52, 152, 219, 0.04));
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.alert-card.roi-movement {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0.04));
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.alert-card.pc-resource {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.08), rgba(156, 39, 176, 0.04));
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.alert-card.agent-status {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.08), rgba(96, 125, 139, 0.04));
    border: 1px solid rgba(96, 125, 139, 0.2);
}

.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-card.camera-offline .alert-icon {
    background: #dc3545;
}

.alert-card.network-disconnected .alert-icon {
    background: #3498db;
}

.alert-card.roi-movement .alert-icon {
    background: #ffc107;
}

.alert-card.pc-resource .alert-icon {
    background: #9c27b0;
}

.alert-card.agent-status .alert-icon {
    background: #607d8b;
}

.alert-icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(100%);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 4px;
}

.alert-count {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

/* Tables Section */
.tables-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 20px;
    min-height: 500px;
    margin-bottom: 20px;
}

.program-section,
.agent-section,
.resource-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Grid positioning */
.agent-section {
    grid-column: 1;
    grid-row: 1;
    height: 500px;
}

.program-section {
    grid-column: 2;
    grid-row: 1;
    height: 500px;
}

.resource-section {
    grid-column: 1;
    grid-row: 1;
    height: 500px;
}

.program-section h3,
.agent-section h3,
.resource-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    padding: 20px 20px 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e6ed;
    flex-shrink: 0;
}

/* Table containers with scroll */
.program-table-container,
.agent-table-container,
.resource-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.program-table-container::-webkit-scrollbar,
.agent-table-container::-webkit-scrollbar,
.resource-table-container::-webkit-scrollbar {
    width: 6px;
}

.program-table-container::-webkit-scrollbar-track,
.agent-table-container::-webkit-scrollbar-track,
.resource-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.program-table-container::-webkit-scrollbar-thumb,
.agent-table-container::-webkit-scrollbar-thumb,
.resource-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.program-table-container::-webkit-scrollbar-thumb:hover,
.agent-table-container::-webkit-scrollbar-thumb:hover,
.resource-table-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Table Filters */
.cameras-filters,
.agent-filters {
    display: none;
}

.events-filters {
    display: flex;
    gap: 0;
    padding: 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e6ed;
    flex-shrink: 0;
}

.camera-branch-filter,
.camera-code-filter,
.camera-status-filter,
.agent-branch-filter,
.agent-id-filter,
.agent-status-filter {
    padding: 8px 10px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #2c3e50;
    background: white;
    cursor: pointer;
    flex: 1;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

/* Events Filters - Clean Design */
.event-branch-filter {
    width: 25%;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid #e0e6ed;
    background: white;
    font-size: 0.85rem;
    color: #2c3e50;
    cursor: pointer;
    outline: none;
}

.event-camera-filter {
    width: 25%;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid #e0e6ed;
    background: white;
    font-size: 0.85rem;
    color: #2c3e50;
    cursor: pointer;
    outline: none;
}

.event-type-filter {
    width: 30%;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid #e0e6ed;
    background: white;
    font-size: 0.85rem;
    color: #2c3e50;
    cursor: pointer;
    outline: none;
}

.camera-branch-filter:focus,
.camera-code-filter:focus,
.camera-status-filter:focus,
.event-branch-filter:focus,
.event-camera-filter:focus,
.event-type-filter:focus,
.event-manage-filter:focus {
    outline: none;
    border-color: #81C344;
    box-shadow: 0 0 0 2px rgba(129, 195, 68, 0.1);
}

.camera-branch-filter::placeholder,
.camera-code-filter::placeholder,
.camera-status-filter::placeholder,
.event-branch-filter::placeholder,
.event-camera-filter::placeholder,
.event-type-filter::placeholder,
.event-manage-filter::placeholder {
    color: #7f8c8d;
    font-weight: 500;
}

.event-manage-header {
    width: 20%;
    padding: 12px 15px;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border-bottom: 1px solid #e0e6ed;
    background: #f8f9fa;
}

.event-branch-filter:focus,
.event-camera-filter:focus,
.event-type-filter:focus {
    border-bottom-color: #81C344;
}

/* Tables */
.cameras-table,
.agent-table,
.events-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.cameras-table td,
.agent-table td {
    padding: 12px 8px;
    text-align: center;
    font-size: 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

.events-table th,
.events-table td {
    padding: 15px 12px;
    text-align: center;
    font-size: 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

/* Events table column widths to match filters */
.events-table td:nth-child(1) {
    width: 25%;  /* Branch column */
}

.events-table td:nth-child(2) {
    width: 25%;  /* Camera Code column */
}

.events-table td:nth-child(3) {
    width: 30%;  /* Event Type column */
}

.events-table td:nth-child(4) {
    width: 20%;  /* Manage column */
}

.events-table th {
    background: #ffffff;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    border-bottom: 2px solid #e0e6ed;
}

.cameras-table td:first-child,
.events-table td:first-child {
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.cameras-table tbody tr:nth-child(odd),
.events-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.cameras-table tbody tr:nth-child(even),
.events-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.cameras-table tbody tr:hover,
.events-table tbody tr:hover {
    background-color: #e9ecef !important;
    transition: background-color 0.3s ease;
}

.cameras-table tr:last-child td,
.events-table tr:last-child td {
    border-bottom: none;
}

/* Status Cell */
.status-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    vertical-align: middle;
}

.status-indicator {
    width: 10px;
    height: 10px;
    padding: 5px 5px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.status-indicator.online {
    background: #27ae60;
    border-color: #229954;
}

.status-indicator.offline {
    background: #e74c3c;
    border-color: #c0392b;
}

.status-text {
    font-size: 0.75rem;
    font-weight: 600;
}

.status-cell .status-text {
    color: #6c757d;
}

.status-indicator.online + .status-text {
    color: #27ae60;
}

.status-indicator.offline + .status-text {
    color: #e74c3c;
}


/* Manage Cell */
.manage-cell {
    text-align: center;
    padding: 15px 20px;
    vertical-align: middle;
    width: 60px;
    min-width: 60px;
}

.manage-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) saturate(100%) invert(35%) sepia(8%) saturate(1090%) hue-rotate(169deg) brightness(93%) contrast(86%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.manage-icon:hover {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
    transform: scale(1.1);
}

/* Responsive Design for Alarms Page - Laptop/Notebook screens */
@media (max-width: 1300px) {
    .event-alerts-cards {
        gap: 12px;
    }
    
    .alert-card {
        padding: 15px;
    }
    
    .alert-icon {
        width: 50px;
        height: 50px;
    }
    
    .alert-icon-img {
        width: 24px;
        height: 24px;
    }
    
    .alert-count {
        font-size: 1.8rem;
    }
    
    .tables-section {
        gap: 15px;
    }
}

@media (max-width: 1200px) {
    .event-alerts-cards {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        gap: 10px;
    }
    
    .alert-card {
        padding: 12px;
    }
    
    .alert-title {
        font-size: 0.9rem;
    }
    
    .alert-count {
        font-size: 1.7rem;
    }
    
    .tables-section {
        gap: 12px;
    }
    
    .cameras-table,
    .agent-table,
    .events-table {
        font-size: 0.9rem;
    }
    
    .cameras-table td,
    .agent-table td,
    .events-table td {
        padding: 10px 8px;
    }
    
    .camera-branch-filter,
    .camera-code-filter,
    .camera-status-filter,
    .agent-branch-filter,
    .agent-id-filter,
    .agent-status-filter,
    .event-branch-filter,
    .event-camera-filter,
    .event-type-filter {
        font-size: 0.85rem;
        padding: 5px 8px;
        min-width: 90px;
    }
}
