/* Demo notice banner */
.historical-requests-demo-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 1rem;
    color: #856404;
}

.historical-requests-demo-notice a {
    color: #145392;
    font-weight: 600;
    text-decoration: underline;
}

.historical-requests-demo-notice a:hover {
    color: #1a6bb8;
}

/* Page wrapper and header */
.historical-requests-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.historical-requests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.historical-requests-title {
    margin: 0;
    font-size: 1.75rem;
    color: #145392;
    font-weight: 700;
}

.historical-requests-cta {
    padding: 10px 20px;
    background: #145392;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.historical-requests-cta:hover {
    background: #1a6bb8;
    color: white;
}

/* Empty states */
.historical-requests-empty-card {
    text-align: center;
    padding: 40px;
}

.historical-requests-empty-title {
    color: #145392;
    margin-bottom: 20px;
    font-size: 1.35rem;
}

.historical-requests-empty-text {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 30px;
}

.historical-requests-empty-text:last-child {
    margin-bottom: 0;
}

.historical-requests-empty-link {
    color: #145392;
    text-decoration: underline;
}

.historical-requests-empty-link:hover {
    color: #1a6bb8;
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.request-card {
    margin-top: 25px;
    flex: 3; /* Take up more space compared to the filter */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Delete button top-right */
.request-card .delete-request {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    color: #444;
}

.request-card .delete-request:hover {
    color: #c00;
}

.request-card .delete-request i {
font-size: 1.1rem;
}

.request-detail-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #000;
    margin-top: 0;
    font-size: 1.5em;
    margin-bottom: 20px;
    width: auto;
    text-decoration: underline;
}

.request-card .save-button {
    display: none;
}

.request-card .editable-email-content {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 10px;
    max-width: none;
    white-space: normal;
    word-wrap: break-word;
    width: auto;
    color: black;
    text-align: left;
    /* Allow vertical resizing by the user */
    resize: vertical;
    min-height: 100px;
    height: 190px;
    max-height: none;
    overflow: auto; /* Required for resize to work */
    pointer-events: auto;
    user-select: text;
}

.filter-form-container {
    margin-top: 25px;
    flex: 1; /* Take up less space compared to the card */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-form-combined {
    max-width: 280px;
}

.filter-form-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-form input[type="number"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-form button,
.filter-form-submit {
    padding: 8px 16px;
    background-color: #145392;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.filter-form button:hover,
.filter-form-submit:hover {
    background-color: #1a6bb8;
}

    /* Responsive styles for smaller screens */
    @media (max-width: 768px) {
    .flex-container {
        flex-direction: column; /* Stack elements vertically */
        gap: 10px;
    }

    .request-card,
    .filter-form-container {
        width: 100%; /* Take full width */
        flex: none; /* Remove flex-grow/shrink */
    }

    .request-detail-heading {
        font-size: 1.2em;
    }

    .editable-email-content {
        font-size: 0.9em; /* Adjust font size for readability */
    }

    .filter-form button {
        padding: 10px; /* Increase button size for touch devices */
    }
}

@media (max-width: 480px) {
    .request-detail-heading {
        font-size: 1em;
    }

    .filter-form input[type="text"],
    .filter-form select {
        font-size: 0.9em; /* Adjust input font size */
    }

    .filter-form button {
        font-size: 0.9em;
    }
}

/* Calendar: submitted & due dates */
.historical-calendar-wrapper {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 20px;
}

.historical-calendar {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.historical-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.historical-calendar-title {
    margin: 0;
    font-size: 1.15rem;
    color: #145392;
    font-weight: 600;
}

.historical-calendar-nav {
    color: #145392;
    text-decoration: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
}

.historical-calendar-nav:hover {
    background: #f0f7ff;
    color: #1a6bb8;
}

.historical-calendar-hint {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.historical-calendar-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.historical-calendar-grid th {
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    color: #fff;
    background: #145392;
    border-bottom: 1px solid #0d3a6b;
}

.historical-calendar-grid td {
    padding: 4px;
    vertical-align: top;
    border: 1px solid #eee;
    min-height: 52px;
    height: 52px;
}

.historical-calendar-day {
    background: #fafafa;
}

.historical-calendar-day.has-events {
    background: #f0f9ff;
}

.historical-calendar-day.is-today {
    background: #e8f4fd;
    outline: 2px solid #145392;
    outline-offset: -2px;
}

.historical-calendar-day .day-num {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.historical-calendar-day .day-events {
    margin-top: 2px;
}

.historical-calendar-day .day-submitted {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
}

.historical-calendar-day .day-submitted a {
    color: #145392;
    text-decoration: none;
}

.historical-calendar-day .day-submitted a:hover {
    text-decoration: underline;
}