/* General Body & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

h1, h2, h3 {
    color: #444;
}

/* Layout */
.container {
    width: 90%;
    max-width: 960px;
    margin: 20px auto;
    padding: 0;
}

header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

header a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem 5%;
    font-size: 0.9em;
    color: #777;
}

/* Components */
.card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Forms */
.search-form {
    display: flex;
    gap: 10px;
}

input[type="text"], input[type="url"], input[type="number"], input[type="search"] {
    box-sizing: border-box; /* Important for padding and width */
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.btn {
    display: inline-block;
    background: #5c67f2;
    color: #fff;
    padding: 5px 10px;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-size: 1em;
    white-space: nowrap; /* Prevents button text from wrapping */
}

.btn:hover {
    background: #4a54c2;
}

/* Pagination Active Page */
.btn-active {
    display: inline-block;
    padding: 5px 10px;
    border: 0;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    font-size: 1em;
    white-space: nowrap; /* Prevents button text from wrapping */
    background-color: #4a54c2; /* darker blue than normal .btn */
    color: white;
    font-weight: bold;
    cursor: default; /* not clickable */
}

.btn-active:hover {
    background-color: #4a54c2; /* prevent hover color change */
}

.btn-disabled {
    display: inline-block;
    background: #ccc;         /* light gray background */
    color: #666;              /* darker gray text */
    padding: 5px 10px;
    border: 0;
    border-radius: 4px;
    cursor: not-allowed;      /* indicates it's not clickable */
    text-decoration: none;
    text-align: center;
    font-size: 1em;
    white-space: nowrap;
}

/* Disable hover effect */
.btn-disabled:hover {
    background: #ccc;
    color: #666;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border: 1px solid #ddd;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

tr:last-child td {
    border-bottom: none;
}

th {
    background-color: #f8f8f8;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 600px) {
    .search-form {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        box-sizing: border-box;
    }

    form a { /* Generic cancel link styling in forms */
        display: block;
        text-align: center;
        margin-top: 10px;
        margin-left: 0 !important; /* Override inline styles */
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex; /* Shown when active class is added */
}

.modal-content {
    background: white;
    padding: 20px 30px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    background: none;
}

/* Star Rating Styles */

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
}

.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;
}

.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffc107;
}

.metric {
    font-size: 1.5em;
    font-weight: bold;
}

.delta {
    font-size: 0.9em;
}

.delta.up {
    color: #2e7d32; /* green */
}

.delta.down {
    color: #c62828; /* red */
}

/* Style the order card (from order history) */
.order-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

/* Summary styling */
.order-card summary {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* remove default triangle */
    position: relative;
    padding-right: 20px;
}

/* Remove default triangle in Firefox */
.order-card summary::-webkit-details-marker {
    display: none;
}

/* Arrow using pseudo-element */
.order-card summary::after {
    content: "▶"; /* right-pointing arrow */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.2s ease;
    font-size: 0.8em;
    color: #555;
}

/* Rotate arrow when open */
.order-card[open] summary::after {
    transform: translateY(-50%) rotate(90deg);
}

/* Collapsible content styling */
.order-details {
    margin-top: 10px;
}

/* Optional: nested card styling for reviewable groups */
.reviewable-group {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.reviewable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-success {
    color: #28a745;
    font-weight: bold;
}
/* Action required asterisk */
.order-card summary .action-required {
    color: red;
    font-weight: bold;
}
