#requestContainer {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e1e8ed;
}

#header-image {
    height: 50px;
    width: auto;
}

#refreshDiv {
    display: flex;
    align-items: center;
    cursor: pointer;
}

#refreshButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #1976d2;
}

    #refreshButton:hover {
        color: #1565c0;
    }

    #refreshButton:focus-visible {
        outline: 2px solid #1976d2;
        outline-offset: 2px;
    }

/* Main Content Area */
#main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: #f2f2f2;
    position: relative;
}

/* Request Cards Header */
#requestCardsHeader {
    background: #ffffff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 0;
}

#requestCardsHeaderSubDiv {
    display: grid;
    grid-template-columns: 120px 1fr 200px 80px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e1e8ed;
}

/* Request Cards Container */
#requestCardsDiv {
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Request Cards Overlay */
#requestCardsDivOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding-top: 5rem;
}

.form-loading-overlay {
    text-align: center;
}

.form-loading-content {
    transform: translateY(3rem);
}

.loading-text {
    font-size: 1rem;
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top: 4px solid #005ea2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Individual Request Card */
.requestCard {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    border: 1px solid #f0f3f7;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    width: 100%;
    border-radius: 0;
    position: relative;
    padding: 0;
}

.requestList li:last-child .requestCard {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.requestCard:hover {
    background: #f8f9fa;
    transform: translateX(4px);
    box-shadow: 4px 0 0 0 #1976d2 inset, -4px 0 0 0 #1976d2 inset;
}

.requestCard:focus-within {
    background: #f8f9fa;
}

/* Request Card Items */
.requestCardItem {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #37474f;
    flex-shrink: 0;
}

.requestCardTimeStamp {
    flex: 0 0 120px;
    font-weight: 500;
    color: #546e7a;
    font-variant-numeric: tabular-nums;
}

.requestCardAddress {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #263238;
}

.requestCardCustomer {
    flex: 0 0 200px;
    color: #546e7a;
}

.requestCardDelete {
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D32721;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem;
    margin: 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #D32721;
    background: #f6f6f6;
    white-space: nowrap;
}

.requestCardDelete:hover {
    background: #ffebee;
    color: #c62828;
}

.requestCardDelete:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: -2px;
}

/* Footer */
#footer {
    padding: 1rem 2rem;
    background: #ffffff;
    border-top: 1px solid #e1e8ed;
    font-size: 0.875rem;
    color: #455a64;
    text-align: center;
}

#refreshInfo {
    font-weight: 500;
    color: #546e7a;
    font-variant-numeric: tabular-nums;
}

.requestList {
    list-style: none;
    margin: 0;
    padding: 0;
}

.requestCardListItem {
    margin: 0;
    padding: 0;
}

.requestSelect {
    all: unset;
    display: flex;
    flex: 1;
    cursor: pointer;
    padding: 1.25rem 1.5rem;
}

.requestSelect:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: -2px;
}

/* Responsive Design */
@media (min-width: 768px) and (max-width: 1400px) {
    .container, .container-md, .container-sm {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    #main {
        padding: 1rem;
        margin-top: 0;
    }

    #header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "logo title refresh";
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    #header-image {
        grid-area: logo;
        height: 40px;
    }

    #header h1 {
        grid-area: title;
        font-size: 1.1rem;
        text-align: center;
        margin: 0;
    }

    #refreshDiv {
        grid-area: refresh;
        margin-left: 0;
    }

    #requestCardsHeaderSubDiv {
        display: none;
    }

    .requestCard {
        flex-direction: row;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
    }

    .requestSelect {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 1rem;
        flex: 1;
        width: auto;
    }

    .requestCardItem {
        padding: 0.25rem 0;
    }

    .requestCardItem::before {
        content: attr(data-label);
        font-weight: 600;
        color: #546e7a;
        margin-right: 0.5rem;
        font-size: 0.85rem;
    }

    .requestCardDelete {
        align-self: stretch;
        width: auto;
        padding: 0 1rem;
        border-radius: 0;
        background: transparent;
        margin: 0;
        font-size: 0.8rem;
    }

    .requestCardTimeStamp,
    .requestCardAddress,
    .requestCardCustomer {
        width: 100%;
        flex: none;
    }

    .requestCardAddress {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    #header {
        flex-direction: column;
        align-items: stretch;
    }

    #header-image {
        align-self: center;
        height: 35px;
    }

    #header h1 {
        font-size: 1.1rem;
        text-align: center;
    }

    #refreshDiv {
        margin-left: 0;
        justify-content: center;
    }
}

/* Empty State */
#requestCardsDiv:empty::after {
    content: "No pending requests";
    display: block;
    padding: 3rem;
    text-align: center;
    color: #546e7a;
    font-size: 1rem;
    font-style: italic;
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    .requestCard:hover {
        box-shadow: -6px 0 0 0 #000 inset;
        border: 2px solid #000;
    }

    #refreshButton:focus-visible,
    .requestSelect:focus-visible,
    .requestCardDelete:focus-visible {
        outline-width: 3px;
        outline-color: #000;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .requestCard,
    #refreshButton,
    .requestCardDelete {
        transition: none;
    }

    .requestCard:hover {
        transform: none;
    }
}
