/**
 * Public-facing styles for Vehicle Garage.
 * Uses only structural styles so the active WordPress theme controls colors.
 */

/* WRAPPER & CARDS */
.vg-wrapper {
    background: rgba(31, 41, 55, 0.90);
    border: none;
    border-radius: 12px;
    padding: 14px;
    margin-top: 30px;
    box-sizing: border-box;
    max-width: 100%;
}

.vg-wrapper.vg-wrapper-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.vg-wrapper.tight {
    margin-top: 0;
}

.vg-wrapper.navbar {
    margin-top: 0;
    margin-bottom: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 25px;
    font-size: 15px;
}

.vg-wrapper h3 {
    margin-top: 0;
}

.vg-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.vg-wrapper img,
.vg-wrapper a img {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.vg-wrapper-accent {
    border-width: 2px;
}

/* UTILITY CLASSES */
.vg-placeholder {
    background: currentColor;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SERVICE RECORDS TABLE */
.vg-service-records th,
.vg-service-records td {
    padding: 12px 0;
}

.vg-service-records tr {
    border-bottom: 1px solid currentColor;
}

.vg-service-records tr:last-child {
    border-bottom: none;
}

/* ACTIONS */
.vg-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

/* MODALS */
body.vg-modal-open {
    overflow: hidden;
}

.vg-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.vg-modal-overlay {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.vg-modal-box {
    position: relative;
    background: var(--global-palette8, var(--global-palette-background, inherit));
    color: var(--global-palette4, var(--global-palette-foreground, inherit));
    border: 1px solid var(--global-palette-border, currentColor);
    border-radius: 2px;
    padding: 28px 32px 24px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.vg-modal-heading {
    margin: 0 0 20px 0;
    font-size: 1.35em;
    line-height: 1.2;
    padding-right: 32px;
}

.vg-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 2px;
    transition: opacity 0.15s;
}

.vg-modal-close:hover {
    opacity: 0.7;
}

.vg-modal-box label {
    font-weight: 600;
    font-size: 0.9em;
    display: block;
    margin-bottom: 4px;
}

.vg-modal-box input[type="text"],
.vg-modal-box input[type="number"],
.vg-modal-box input[type="date"],
.vg-modal-box select,
.vg-modal-box textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid currentColor;
    border-radius: 2px;
    font-size: 0.95em;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.vg-modal-box input[type="text"]:focus,
.vg-modal-box input[type="number"]:focus,
.vg-modal-box input[type="date"]:focus,
.vg-modal-box select:focus,
.vg-modal-box textarea:focus {
    outline: none;
}

.vg-modal-box p {
    margin: 0 0 14px 0;
}

@media (max-width: 560px) {
    .vg-modal-box {
        padding: 20px 16px 18px;
    }
}

/* PHOTO GRID */
.vg-photo-grid-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.vg-photo-grid-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vg-photo-grid-label {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
}

.vg-photo-grid {
    display: block;
    line-height: 0;
}

.vg-photo-grid-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* MODAL LOADING */
.vg-modal-loading {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: 2px;
    z-index: 10;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.vg-modal-loading .fa-circle-notch {
    font-size: 2.5em;
}

.vg-modal-loading span {
    font-size: 14px;
    display: block;
    margin-top: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* FORM FADE */
#vg-vehicle-form,
#vg-service-form {
    transition: opacity 0.2s ease-in-out, filter 0.2s ease-in-out;
}

#vg-vehicle-form.vg-faded,
#vg-service-form.vg-faded {
    opacity: 0.2;
    filter: blur(2px);
    pointer-events: none;
}

/* DASHBOARD CARD RESPONSIVE STACKING */
@media (max-width: 768px) {
    .vg-wrapper.vg-wrapper-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .vg-wrapper.vg-wrapper-row>a {
        align-self: center;
    }

    .vg-wrapper.vg-wrapper-row .vg-vehicle-card-main {
        width: 100%;
    }

    .vg-wrapper.vg-wrapper-row .vg-vehicle-card-actions {
        width: 100%;
        margin-left: 0;
        align-items: stretch;
    }

    .vg-wrapper.vg-wrapper-row .vg-vehicle-card-actions .button,
    .vg-wrapper.vg-wrapper-row .vg-vehicle-card-actions button {
        width: 100%;
        text-align: center;
    }
}