@import url('./main-layout.css');

html {
    --lumo-primary-color: #1f6f68;
    --lumo-primary-color-50pct: rgba(31, 111, 104, 0.5);
    --lumo-primary-color-10pct: rgba(31, 111, 104, 0.1);
    --lumo-error-color: #b42318;
    --lumo-success-color: #167447;
    --lumo-warning-color: #b54708;
    --lumo-base-color: #f6f7f4;
    --lumo-body-text-color: #202421;
    --lumo-secondary-text-color: #68736d;
    --lumo-border-radius-m: 8px;
    --lumo-border-radius-l: 8px;
    background: #f6f7f4;
}

body {
    background:
        linear-gradient(135deg, rgba(31, 111, 104, 0.09), rgba(204, 133, 78, 0.08) 38%, rgba(246, 247, 244, 0) 70%),
        #f6f7f4;
}

vaadin-button[theme~='primary'] {
    box-shadow: 0 8px 20px rgba(31, 111, 104, 0.2);
}

.dashboard-view,
.vehicle-list-view,
.vehicle-form-view,
.users-view,
.change-password-view,
.login-view {
    box-sizing: border-box;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 28px;
    gap: 18px;
}

.vehicle-list-view {
    align-self: stretch;
    max-width: none;
    width: 100% !important;
    margin: 0;
    padding: 18px 22px 24px;
}

.users-view,
.change-password-view {
    max-width: none;
}

.page-hero,
.page-heading-row,
.content-panel,
.grid-panel,
.form-section,
.metric-card,
.status-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(32, 36, 33, 0.08);
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(32, 36, 33, 0.08);
}

.page-hero {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        linear-gradient(120deg, rgba(31, 111, 104, 0.96), rgba(42, 84, 109, 0.92)),
        #1f6f68;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: auto 24px 24px auto;
    width: 210px;
    height: 84px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transform: skewX(-14deg);
}

.page-hero h1,
.page-heading-row h1 {
    margin: 0;
    font-size: 2.15rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.page-hero p,
.page-heading-row p {
    margin: 0;
    max-width: 720px;
    color: inherit;
    opacity: 0.82;
}

.hero-actions {
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.page-heading-row {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.metric-grid,
.status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-label,
.metric-helper,
.section-helper,
.vehicle-meta,
.recent-meta,
.muted-copy {
    color: var(--lumo-secondary-text-color);
}

.metric-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-value {
    color: #202421;
    font-size: 1.85rem;
    font-weight: 800;
}

.metric-helper {
    font-size: 0.9rem;
}

.content-panel,
.grid-panel,
.form-section {
    padding: 20px;
}

.section-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
    letter-spacing: 0;
}

.status-card {
    min-height: 84px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 4px solid #1f6f68;
}

.status-count {
    font-size: 1.6rem;
    font-weight: 800;
}

.status-label {
    color: var(--lumo-secondary-text-color);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-watching {
    background: #eaf4f2;
    color: #1f6f68;
    border-color: #1f6f68;
}

.status-researching {
    background: #eef2ff;
    color: #3446a8;
    border-color: #5668d8;
}

.status-ready-to-bid,
.status-existing-bid {
    background: #fff4df;
    color: #9a4f10;
    border-color: #cc854e;
}

.status-pass,
.status-lost {
    background: #f7e9e7;
    color: #9f2d20;
    border-color: #c24b3b;
}

.status-won {
    background: #e8f5ed;
    color: #167447;
    border-color: #167447;
}

.status-sold {
    background: #ede9f6;
    color: #4b2d8a;
    border-color: #7c5cbf;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(32, 36, 33, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.recent-row:hover {
    border-color: rgba(31, 111, 104, 0.28);
    box-shadow: 0 10px 24px rgba(32, 36, 33, 0.08);
    transform: translateY(-1px);
}

.recent-title,
.vehicle-name {
    display: block;
    color: #202421;
    font-weight: 800;
}

.grid-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.search-field {
    min-width: 320px;
    max-width: 520px;
    flex: 1 1 360px;
}

.filter-bar {
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-bar vaadin-combo-box {
    min-width: 170px;
    flex: 0 1 190px;
}

.filter-bar vaadin-button {
    margin-left: auto;
}

.vehicle-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.vehicle-grid {
    width: 100%;
    min-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(32, 36, 33, 0.08);
}

vaadin-grid.vehicle-grid::part(header-cell) {
    background: #eef3ef;
    color: #4d5953;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

vaadin-grid.vehicle-grid::part(body-cell) {
    background: #fff;
}

.modern-form {
    margin-top: 14px;
}

.bid-receipt {
    box-sizing: border-box;
    max-width: 700px;
    margin-top: 24px;
    padding: 0;
    border: 1px solid rgba(31, 111, 104, 0.15);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(20, 33, 43, 0.06);
}

.receipt-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 210px;
    gap: 18px;
    align-items: center;
    min-height: 52px;
    padding: 4px 24px;
    border-bottom: 1px solid rgba(20, 33, 43, 0.05);
    background: #ffffff;
    transition: background-color 0.25s ease;
}

.receipt-row:hover {
    background-color: rgba(31, 111, 104, 0.02);
}

.receipt-label {
    color: #1c2730;
    font-size: 0.92rem;
    font-weight: 700;
}

.receipt-row vaadin-big-decimal-field {
    width: 100%;
    --vaadin-input-field-background: transparent;
    --vaadin-input-field-border-width: 0;
    --vaadin-input-field-border-color: transparent;
    --vaadin-input-field-value-color: #14212b;
    --vaadin-input-field-placeholder-color: #60717c;
}

.receipt-row vaadin-big-decimal-field::part(input-field) {
    box-shadow: none;
    min-height: 38px;
    padding-left: 8px;
    padding-right: 8px;
    border-bottom: 1.5px dashed rgba(20, 33, 43, 0.2);
    border-radius: 0;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.receipt-row vaadin-big-decimal-field[focused]::part(input-field) {
    border-bottom: 1.5px solid #1f6f68;
    background-color: rgba(31, 111, 104, 0.04);
}

.receipt-row vaadin-big-decimal-field::part(value) {
    text-align: right;
    font-weight: 750;
}

.receipt-row vaadin-big-decimal-field [slot="prefix"] {
    font-size: 0.85rem;
    font-weight: 700;
    color: #60717c;
}

.receipt-row:nth-child(even) vaadin-big-decimal-field [slot="prefix"] {
    color: #d93d31;
}

.receipt-total-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 210px;
    gap: 18px;
    align-items: center;
    min-height: 72px;
    padding: 0 24px;
    background: linear-gradient(135deg, #1f6f68, #14212b);
    color: #ffffff;
    border-top: none;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.receipt-total-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid-max-bid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #1f6f68;
    background: #eaf4f2;
    border: 1px solid rgba(31, 111, 104, 0.25);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.92rem;
    box-shadow: 0 2px 6px rgba(31, 111, 104, 0.08);
}

.receipt-total-value {
    justify-self: end;
    color: #ffffff;
    font-size: 1.95rem;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.02em;
}

.form-section {
    width: 100%;
    box-sizing: border-box;
}

.form-actions {
    justify-content: flex-end;
    width: 100%;
    padding-bottom: 16px;
}

.danger-zone {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 24px;
    border-top: 1px solid rgba(180, 35, 24, 0.14);
    margin-top: 4px;
}

vaadin-text-field,
vaadin-integer-field,
vaadin-big-decimal-field,
vaadin-combo-box,
vaadin-text-area {
    --vaadin-input-field-background: #f8faf8;
    --vaadin-input-field-border-width: 1px;
    --vaadin-input-field-border-color: rgba(32, 36, 33, 0.12);
}

@media (max-width: 900px) {
    .dashboard-view,
    .vehicle-list-view,
    .vehicle-form-view {
        padding: 18px;
    }

    .metric-grid,
    .status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-heading-row {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .metric-grid,
    .status-grid {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .page-heading-row,
    .content-panel,
    .grid-panel,
    .form-section {
        padding: 16px;
    }

    .receipt-row,
    .receipt-total-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .receipt-total-value {
        text-align: left;
    }
}
