// Shared styles for viewer components (events, logs, etc.)
.viewer-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  
  .viewer-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    
    ::ng-deep .p-card-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
    }
    
    ::ng-deep .p-card-content {
      flex: 1;
      padding: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
  }

  ::ng-deep .p-toolbar,
  ::ng-deep .p-paginator {
    background-color: inherit;
  }

  ::ng-deep .p-toolbar-end {
    width: 100%
  }
  
  // Filter controls
  .filter-container {
    .filter-toolbar {
      background: transparent;
      border: none;
      padding: 0;
      
      // Fix for mobile layout
      @media (max-width: 768px) {
        flex-direction: column;
        align-items: stretch;
        
        ::ng-deep .p-toolbar-end {
          justify-content: space-between;
          margin-top: 0.5rem;
        }
      }
    }

    ::ng-deep .filter-toolbar.p-toolbar{
      border: none;
    }

    ::ng-deep.date-filter {
      width: 200px;
    }
    
    // Filter actions container for better mobile layout
    .filter-actions-container {
      width: 100%;
      
      .filter-actions-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
        
        @media (max-width: 768px) {
          flex-direction: column;
          align-items: flex-start;
        }
      }
    }
    
    .search-input {
      width: 200px;

      @media (max-width: 768px) {
        width: 100%;
      }
    }
    
    .filter-stats {
      margin-right: 1rem;
      min-width: 100px;
      
      @media (max-width: 768px) {
        font-size: 0.75rem;
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: 100%;
      }
    }
    
    // Fix for dropdown sizing
    ::ng-deep {
      .p-select {
        min-width: 180px;
        
        @media (max-width: 768px) {
          width: 100%;
        }
        
        .p-select-label {
          width: 100%;
        }
      }
      
      // Fixed width dropdown solution
      .fixed-width-dropdown {
        width: 200px;
        
        .p-select-label {
          width: 100%;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        
        @media (max-width: 768px) {
          width: 100%;
        }
      }
    }
  }
  
  // Console style viewer
  .viewer-console {
    flex: 1;
    overflow-y: auto;
    position: relative;
    min-height: 50vh;
    max-height: 60vh;
    display: block;
    
    // Items list
    .items-list {
      padding: 0.5rem;
      display: block;
      width: 100%;
      z-index: 1;
    }
    
    // Item entry styling
    .item-entry {
      margin-bottom: 0.5rem;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      background-color: var(--surface-card);
      transition: all 0.2s ease;
      
      &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
      
      // Item entry header
      .item-entry-header {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        flex-wrap: wrap;
        
        &.expandable {
          cursor: pointer;
          
          &:hover {
            background-color: var(--surface-hover);
          }
        }
        
        @media (max-width: 768px) {
          align-items: flex-start;
          gap: 0.5rem;
        }
        
        .item-timestamp {
          display: flex;
          flex-direction: column;
          min-width: 140px;
          
          @media (max-width: 768px) {
            width: 100%;
            margin-bottom: 0.5rem;
          }
          
          .item-date {
            font-size: 0.8rem;
            color: var(--text-color-secondary);
          }
          
          .item-time {
            font-weight: 600;
            font-family: monospace;
            font-size: 0.9rem;
          }
        }
        
        .item-severity {
          min-width: 7rem;
          
          @media (max-width: 768px) {
            margin-bottom: 0.5rem;
          }
        }
        
        .item-type {
          min-width: 8rem;
          
          .item-type-badge {
            background-color: var(--primary-100);
            color: var(--primary-700);
            padding: 0.25rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
            white-space: nowrap;
            
            @media (max-width: 768px) {
              margin-bottom: 0.5rem;
            }
          }
        }
        
        .item-source {
          min-width: 8rem;
          
          .item-source-badge {
            background-color: var(--surface-hover);
            color: var(--text-color-secondary);
            padding: 0.25rem 0.5rem;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 500;
            font-family: monospace;
            white-space: nowrap;
            
            @media (max-width: 768px) {
              margin-bottom: 0.5rem;
            }
          }
        }
        
        .item-message {
          flex: 1;
          word-break: break-word;
          font-family: var(--font-family);
          line-height: 1.5;
          padding: 0 0.5rem;
          min-width: 200px;
          
          @media (max-width: 768px) {
            width: 100%;
            margin-bottom: 0.5rem;
            padding: 0;
          }
        }
        
        .item-correlation {
          .correlation-tag {
            ::ng-deep .p-tag-value {
              font-family: monospace;
              font-size: 0.7rem;
              font-weight: 500;
            }
          }
          
          @media (max-width: 768px) {
            margin-bottom: 0.5rem;
          }
        }
        
        .item-actions {
          display: flex;
          gap: 0.25rem;
          margin-left: auto;
          opacity: 0.6;
          transition: opacity 0.2s ease;
          
          @media (max-width: 768px) {
            width: 100%;
            justify-content: flex-end;
          }
          
          &.item-actions-start {
            margin-left: 0;
            margin-right: 0.5rem;
            order: -1;
            
            @media (max-width: 768px) {
              justify-content: flex-start;
            }
          }
        }
      }
      
      &:hover .item-actions {
        opacity: 1;
      }
      
      // Item details (expanded view)
      .item-details {
        padding: 0.75rem 1rem;
        background-color: var(--surface-hover);
        border-top: 1px solid var(--surface-border);
        
        .item-data {
          .data-label {
            font-weight: 600;
            color: var(--text-color-secondary);
            margin-bottom: 0.5rem;
          }
          
          .data-content {
            margin: 0;
            padding: 0.75rem;
            background-color: var(--surface-section);
            border-radius: 4px;
            font-family: monospace;
            font-size: 0.85rem;
            overflow-x: auto;
            white-space: pre-wrap;
            word-break: break-word;
            
            &.data-content pre {
              margin: 0;
              white-space: pre;
            }
          }
        }
        
        .item-metadata {
          display: flex;
          flex-wrap: wrap;
          gap: 1rem;
          margin-top: 0.5rem;
          
          .metadata-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            
            .metadata-label {
              font-weight: 600;
              color: var(--text-color-secondary);
            }
            
            .metadata-value {
              padding: 0.25rem 0.5rem;
              background-color: var(--surface-card);
              border-radius: 4px;
              font-family: monospace;
              font-size: 0.85rem;
            }
          }
        }
      }
    }
    
    // Empty state
    .empty-items {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      padding: 2rem;
      text-align: center;
      
      .empty-message {
        display: flex;
        flex-direction: column;
        align-items: center;
        
        .empty-icon {
          font-size: 3rem;
          color: var(--text-color-secondary);
          margin-bottom: 1rem;
          opacity: 0.5;
        }
        
        .empty-text {
          font-size: 1.25rem;
          font-weight: 500;
          margin-bottom: 0.5rem;
        }
        
        p {
          color: var(--text-color-secondary);
        }
      }
    }
  }
}

// Item controls
.item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

// Header title container and status tag styles
.header-title-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  
  h2 {
    margin: 0;
    line-height: 1.2;
  }
  
  ::ng-deep .status-tag {
    display: flex;
    align-items: center;
    height: 1.5rem;
    
    .p-tag-value {
      line-height: 1;
    }
  }
}

// Responsive styles
@media (max-width: 768px) {
  // Improve mobile button layout
  .p-button-rounded.p-button-text {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  // Improve filter button on mobile
  .p-button-outlined {
    padding: 0.5rem;
    font-size: 0.875rem;
    width: 100%;
  }
  
  // Improve filter inputs container
  .filter-inputs-container {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    
    .search-input {
      padding-left: 2rem;
    }
  }
  
  // Improve clear filters button
  .clear-filters-btn {
    width: 100%;
    margin-left: 0 !important;
    justify-content: center;
  }
} 