﻿/* Global shared grid styles (single source of truth for all grids) */
/* Lighter backgrounds, goldenrod left-aligned headers, tighter spacing, left-aligned cells */

.activities-section,
.admin-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.06);
}

/* Grid containers */
.activities-grid,
.admin-grid,
.notices-grid,
.events-grid {
    display: grid !important;
    grid-auto-flow: row;
    gap: 8px; /* match Blazor spacing */
    align-items: start; /* top/left align multi-line content */
    width: 100%;
    box-sizing: border-box;
}
.admin-grid {
    gap: 0px;
}
/* Optional sensible defaults for the common grids — adjust per page as needed */
.activities-grid {
    /* Column widths are now defined inline via GridTemplateColumns parameter */
    min-width: 100%;
    width: 100%;
    grid-auto-rows: minmax(90px, auto); /* keep consistent row height for vehicle rows */
    grid-auto-flow: row; /* ensure rows are filled left-to-right */
}

.admin-grid {
    grid-template-columns: 180px 1fr 160px 120px;
    min-width: 470px;
}

/* Column headers: left-aligned  */
.grid-header {
    text-align: left;
    color: white; 
    background: rgba(3,54,91,0.85);
    padding: 6px 8px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding-top: 16px;
}

/* Cells: lighter background, left-aligned column contents */
.grid-cell {
    text-align: left;
    padding: 6px 8px;
    background: #e1dfdf;
    border-radius: 4px;
    color: darkgray;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vehicle grid specific tweaks */
.vehicle-cell { display: flex; align-items: center; padding: 12px 10px; min-height: 90px; background: transparent; color: #fff; }
.vehicle-cell:hover { background: rgba(255,255,255,0.06) !important; color: #fff !important; }
.image-cell { justify-content: center; }
.vehicle-thumb { height: 72px; width: auto; border-radius: 6px; display: block; max-width: 100%; }
.no-image { height:72px; width:100px; background:#333; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:0.8rem; }

/* Column sizing helpers */
.grid-header.price-header { width: 110px; max-width: 110px; }
.price-cell { justify-content: flex-end; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-header.make-header { max-width: 180px; }
.grid-header.mileage-header { max-width: 120px; }

/* Also constrain the corresponding cells when in grid layout */
.activities-grid > .make-cell { max-width: 180px; }
.activities-grid > .mileage-cell { max-width: 120px; }

/* Responsive: collapse columns on narrow screens into a vertical list */
@media (max-width: 800px) {
    .activities-grid {
        display: block;
    }
    .activities-grid .grid-header { display:none; }
    .activities-grid .vehicle-cell { display:flex; justify-content:space-between; padding:10px; border-bottom: 1px solid rgba(0,0,0,0.06); }
}

/* Titles / small helpers */
.activities-title,
.home-activities .activities-title {
    color: #708eaf; /* blue accent */
    margin-bottom: 1rem;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
}

/* Ensure grid wrapper can scroll if needed */
.activities-grid-wrapper {
    width: 100%;
    /* constrain and center grid on larger screens */
    /*max-width: 1500px;*/
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: visible;
    padding: 8px 0;
}

/* Copy of Blazor's home-activities proportions to match visual layout */
.home-activities {
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.06);
}

.home-activities .activities-title {
    color: goldenrod;
    margin-bottom: 0.5rem;
    text-align: left;
    height: 34px;
    font-size: 22px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.home-activities .activities-grid-wrapper {
  width: 100%;
  overflow-x: auto;
}

.home-activities .activities-grid {
  display: grid;
  /* Blazor proportions: Register(90px), Images(1fr), Make(140px), Model(110px), Year(140px), Price(1fr)
     We'll expand to include extra right-hand columns by keeping proportions similar and allowing 1fr for flexible columns. */
  grid-template-columns: 90px 1fr 140px 110px 140px 1fr 120px 110px 130px 90px 110px 110px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 1200px;
}

.home-activities, .admin-grid .grid-header {
    font-weight: 600;
    padding: 10px 12px;
    background: #727272;
    color: #ffffff;
    border-radius: 4px;
    text-align: left;
    white-space: nowrap;
    text-align: left;
}

.home-activities .grid-cell {
    padding: 8px 10px;
    background: rgba(255,255,255,0.98); /* light tile background */
    border-radius: 4px;
    color: #0b2545; /* dark text to match Blazor theme */
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    border: 1px solid rgba(11,37,69,0.04);
}

/* container visual to match Blazor look */

.activities-grid.app-grid {
    /* Use darker interior to match site dark theme */
    background: transparent;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(2,6,23,0.12);
    /* Define 12 explicit columns to match the headers (Register, Images, Make, Model, Year,
       Condition, Mileage, Price, Current Bid, Damages, AutoBid, ManualBid). Widths chosen to
       prevent wrapping while remaining responsive; adjust as needed. */
    grid-template-columns: 140px 120px 160px 160px 80px 120px 120px 110px 130px 110px 110px 110px 110px 110px  !important;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-width: 1900px !important; /* ensure all columns fit; wrapper can scroll */
    margin: 0 auto;
}

/* Ensure headers don't wrap inside this grid (higher specificity) */
.activities-grid.app-grid .grid-header {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Ensure specific column helpers are enforced */
.activities-grid.app-grid .grid-header.price-header {  max-width: 130px !important; }
.activities-grid.app-grid .price-cell { min-width: 110px !important; max-width: 130px !important; }
.activities-grid.app-grid .grid-header.make-header { max-width: 180px !important; }
.activities-grid.app-grid .activities-grid > .make-cell { max-width: 180px !important; }
.activities-grid.app-grid .activities-grid > .mileage-cell { max-width: 120px !important; }

/* Small-screen adjustments */
@media (max-width: 1100px) {
    .activities-grid {
        /* On smaller screens, allow horizontal scroll */
        min-width: 1100px;
    }
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }
}

/* Image and grid layout */
.car-image-column { box-sizing: border-box; flex: 0 0 60%; max-width: 60%; min-width: 320px; padding: 0; display: flex; align-items: flex-start; justify-content: center; }
.car-image-wrapper { position: relative; display: block; width: 100%; max-width: 100%; overflow: hidden; }
.car-image { width: 100%; display: block; background-position: center center; position: relative; }

/* Fixed sizing preferences: image fixed height and grid slightly smaller */
.car-image { height: 300px; max-height: 350px; object-fit: contain; }
.car-image-wrapper img.car-image { display:block; width:100%; height:300px; object-fit:contain; }

/* Deprecated grid overlay styles removed - SVG-based selector is used instead */
/* Keep minimal helper classes in case legacy HTML exists */
.car-grid { display: none; }
