/**
 * Chart Data Grid - Modern Clean Design
 * Borderless, edge-to-edge look with professional styling
 */

/* ============================================
   MODAL INTEGRATION - SEAMLESS EDGE-TO-EDGE
   ============================================ */
.chart-images-table {
    background: white;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;  /* Important for flex to work properly */
}

.chart-modal-content {
    display: flex;
    flex-direction: column;
    gap: 0;  /* Remove gaps for edge-to-edge look */
    height: 100%;
    overflow: hidden;
}

/* Optional: If you want to remove the filters section for ultra-clean look */
.chart-modal-filters {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* ============================================
   GRID CONTAINER - CLEAN EDGE-TO-EDGE
   ============================================ */
.chart-data-grid-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chart-data-grid-container .ag-theme-alpine {
    --ag-header-height: 42px;
    --ag-row-height: 56px;
    --ag-header-background-color: #f8fafc;
    --ag-header-foreground-color: #475569;
    --ag-row-border-color: #e2e8f0;
    --ag-border-color: transparent;
    --ag-wrapper-border-radius: 0;
    border: none !important;
    border-radius: 0 !important;
}

/* ============================================
   HEADER - MINIMAL MODERN STYLE
   ============================================ */
.chart-data-grid-container .ag-header {
    background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.chart-data-grid-container .ag-header-row {
    border: none !important;
}

.chart-data-grid-container .ag-header-cell {
    padding: 0 16px;
    border: none !important;
    border-right: none !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #64748b;
}

/* Modern header style */
.chart-header-modern {
    background: transparent !important;
}

/* Minimal header (for thumbnail and actions columns) */
.chart-header-minimal {
    background: transparent !important;
}

.chart-header-minimal .ag-header-cell-label {
    display: none;  /* Hide header text completely */
}

/* Remove header cell separators for clean look */
.chart-data-grid-container .ag-header-cell::after {
    display: none !important;
}

/* Sort indicator styling */
.chart-data-grid-container .ag-header-cell-sorted-asc .ag-icon,
.chart-data-grid-container .ag-header-cell-sorted-desc .ag-icon {
    color: #6366f1;
}

/* ============================================
   ROWS - CLEAN MODERN AESTHETIC
   ============================================ */
.chart-data-grid-container .ag-row {
    border-bottom: 1px solid #f1f5f9 !important;
    border-left: none !important;
    border-right: none !important;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-data-grid-container .ag-row:hover {
    background-color: #f8fafc !important;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.chart-data-grid-container .ag-row:last-child {
    border-bottom: none !important;
}

/* Remove cell borders */
.chart-data-grid-container .ag-cell {
    border: none !important;
    border-right: none !important;
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

/* ============================================
   THUMBNAIL CELL - MODERN CLEAN
   ============================================ */
.chart-thumbnail-cell {
    padding: 8px !important;
}

.chart-thumbnail-wrapper {
    width: 64px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-thumbnail-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chart-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chart-thumbnail-fallback {
    display: none;
    font-size: 20px;
    color: #cbd5e1;
}

.chart-no-thumbnail {
    width: 64px;
    height: 40px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #cbd5e1;
}

/* ============================================
   SPECIES CELL - MODERN LAYOUT
   ============================================ */
.chart-species-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-species-icon {
    font-size: 22px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.chart-species-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    letter-spacing: -0.2px;
}

/* ============================================
   DATE & TIME CELL - CLEAN STACKED
   ============================================ */
.chart-datetime-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-date {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    letter-spacing: -0.1px;
}

.chart-time {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

/* ============================================
   LOCATION CELL
   ============================================ */
.chart-location-cell {
    font-size: 14px;
    color: #475569;
    font-weight: 400;
}

/* ============================================
   CONFIDENCE CELL - MODERN BAR
   ============================================ */
.chart-confidence-cell {
    padding: 12px 16px !important;
}

.confidence-bar-container {
    width: 100%;
    max-width: 90px;
}

.confidence-bar-background {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.confidence-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #10b981, #059669);
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-percentage {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
    display: block;
}

/* ============================================
   ACTIONS CELL - MODERN BUTTONS
   ============================================ */
.chart-actions-cell {
    padding: 8px 12px !important;
}

.chart-actions-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chart-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    padding: 0;
}

.chart-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.chart-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-action-view:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: white;
}

.chart-action-tag:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.chart-action-edit:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
    color: white;
}

/* ============================================
   REMOVE ALL GRID BORDERS FOR EDGE-TO-EDGE
   ============================================ */
.chart-data-grid-container .ag-root-wrapper {
    border: none !important;
    border-radius: 0 !important;
}

.chart-data-grid-container .ag-root {
    border: none !important;
}

.chart-data-grid-container .ag-body-viewport {
    border: none !important;
}

.chart-data-grid-container .ag-body {
    border: none !important;
}

.chart-data-grid-container .ag-center-cols-container,
.chart-data-grid-container .ag-center-cols-clipper,
.chart-data-grid-container .ag-center-cols-viewport {
    border: none !important;
}

/* ============================================
   REMOVE PAGINATION & FOOTER
   ============================================ */
.chart-data-grid-container .ag-paging-panel {
    display: none !important;
}

.chart-data-grid-container .ag-status-bar {
    display: none !important;
}

/* ============================================
   SCROLLBAR STYLING (MODERN & MINIMAL)
   ============================================ */
.chart-data-grid-container .ag-body-horizontal-scroll::-webkit-scrollbar,
.chart-data-grid-container .ag-body-viewport::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.chart-data-grid-container .ag-body-horizontal-scroll::-webkit-scrollbar-track,
.chart-data-grid-container .ag-body-viewport::-webkit-scrollbar-track {
    background: #f8fafc;
}

.chart-data-grid-container .ag-body-horizontal-scroll::-webkit-scrollbar-thumb,
.chart-data-grid-container .ag-body-viewport::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chart-data-grid-container .ag-body-horizontal-scroll::-webkit-scrollbar-thumb:hover,
.chart-data-grid-container .ag-body-viewport::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .chart-data-grid-container .ag-theme-alpine {
        --ag-row-height: 64px;
    }
    
    .chart-thumbnail-wrapper {
        width: 48px;
        height: 32px;
    }
    
    .chart-no-thumbnail {
        width: 48px;
        height: 32px;
    }
    
    .chart-action-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .chart-species-icon {
        font-size: 18px;
    }
    
    .chart-species-name,
    .chart-date,
    .chart-location-cell {
        font-size: 13px;
    }
}

/* ============================================
   LOADING & EMPTY STATE
   ============================================ */
.chart-data-grid-container .ag-overlay-loading-wrapper {
    background: rgba(255, 255, 255, 0.95);
}

.chart-data-grid-container .ag-overlay-no-rows-wrapper {
    padding: 40px;
}

.chart-data-grid-container .ag-overlay-no-rows-center {
    color: #64748b;
    font-size: 14px;
}
