/* RESET STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #2b2d33; /* Dark slate for text */
    background-color: #faf5e4; /* Antique cream background */
}

/* HEADER STYLES */
.page-header {
    background-color: #faf5e4; /* Antique cream */
    color: #2b2d33; /* Dark slate */
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 2em;
}

.page-header .instructions {
    font-size: 1.1em;
    margin-top: 5px;
}

/* MAIN CONTENT LAYOUT */
.main-content {
    flex: 1;
    display: flex;
    gap: 40px;
    padding: 20px 5%;
    justify-content: center;
}

/* ITEM SELECTION AND ORDER SECTION STYLES */
.item-selection, .order-section {
    flex: 1;
    background-color: #fff; /* Light background for sections */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 600px;
    height: 800px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: 700px;
    border: 1px solid #ddd;
}

.item-selection h2, .order-section h2 {
    font-size: 1.8em;
}

/* FORM CONTROLS */
.selection-controls label {
    display: block;
    margin-top: 20px;
    font-weight: bold;
    font-size: 1.2em;
    color: #2b2d33; /* Dark slate for labels */
}

.selection-controls input,
.selection-controls select {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1.1em;
}

/* SCROLLABLE FILE LIST */
#fileTableContainer {
    flex: 1;
    overflow-y: auto;
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#fileTable {
    width: 100%;
    border-collapse: collapse;
}

#fileTable th, #fileTable td {
    padding: 15px;
    text-align: left;
    font-size: 1.1em;
    color: #2b2d33; /* Dark text */
    border-bottom: 1px solid #ddd;
}

#fileTable thead th {
    position: sticky;
    top: 0;
    background-color: #4b647b; /* Slate blue */
    color: #faf5e4; /* Antique cream text */
    font-weight: bold;
}

#fileTable tbody tr:hover {
    background-color: #eceae4; /* Slightly darker cream for hover */
}

/* SELECTION FOOTER */
.selection-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

#calculatedPages {
    font-weight: bold;
    color: #2b2d33;
    font-size: 1.3em;
}

#addToOrder {
    padding: 12px 25px;
    background-color: #4b647b; /* Slate blue */
    color: #faf5e4; /* Antique cream text */
    border: none;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
}

#addToOrder:hover {
    background-color: #5c7891; /* Lighter slate blue */
}

/* ORDER SUMMARY TABLE */
.order-section {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 600px;
    height: 800px;
    max-width: 700px;
    border: 1px solid #ddd;
}

#orderSummary {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    margin-top: 25px;
}

#orderTable {
    width: 100%;
    border-collapse: collapse;
}

#orderTable thead th {
    position: sticky;
    top: 0;
    background-color: #4b647b; /* Slate blue */
    color: #faf5e4; /* Antique cream text */
    font-weight: bold;
}

#orderTable th, #orderTable td {
    padding: 15px;
    font-size: 1.1em;
    color: #2b2d33; /* Dark text */
    text-align: center;
    border-bottom: 1px solid #ddd;
}

#orderTable .parent-row {
    background-color: #f0f4f8;
    font-weight: bold;
}

#orderTable .child-row {
    background-color: #ffffff;
}

#orderTable tbody tr:hover {
    background-color: #eceae4; /* Slightly darker cream for hover */
}

.remove-icon {
    cursor: pointer;
    color: #4b647b;
    padding: 8px;
    transition: color 0.2s;
}

.remove-icon:hover {
    color: #a14343; /* Reddish tint for remove */
}

.toggle-icon {
    cursor: pointer;
    color: #4b647b;
    font-size: 1.2em;
    padding: 5px;
    transition: color 0.2s;
}

.toggle-icon:hover {
    color: #2b2d33;
}

/* ORDER FOOTER */
.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-top: auto;
}

#totalPages {
    font-size: 1.3em;
    color: #2b2d33;
}

#submitOrder {
    padding: 12px 25px;
    font-size: 1.2em;
    background-color: #4b647b;
    color: #faf5e4;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

#submitOrder:hover {
    background-color: #5c7891;
}

/* FOOTER STYLES - STICKY FOOTER */
.page-footer {
    background-color: #333;
    color: #faf5e4;
    text-align: center;
    padding: 20px;
    font-size: 1.1em;
    margin-top: auto;
    width: 100%;
}

.page-footer nav a {
    color: #faf5e4;
    text-decoration: none;
    margin: 0 15px;
    padding: 10px 0;
}

.page-footer nav a:hover {
    text-decoration: underline;
}
