/*
   Hands-on Project 11-3
   Sung Kim | 7-26-26 | IST-239-W01

   Purpose:
   This project retrieves Wizard Works customer order information from a server-side Perl script.
   The user enters a customer ID and password to request the matching order history.
   Fetch processes the JSON response returned by the server.
   The customer summary and individual orders are displayed in HTML tables.

   This file controls the layout and appearance of the order lookup page and its tables.

   Filename: styles.css
   Related: project11-03.html, project11-03.js, wwlogo.png, wworders.pl
*/

/* Applies border-box sizing to every page element. */
* {
   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
   box-sizing: border-box;
}

/* Removes default spacing and borders from common page elements. */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
   margin: 0;
   padding: 0;
   border: 0;
   font-size: 100%;
   font: inherit;
   vertical-align: baseline;
}

/* Displays HTML5 structural elements as blocks in older browsers. */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
   display: block;
}

/* Sets the page width, font, background, and centered layout. */
body {
   line-height: 1;
   width: 960px;
   background: white;
   margin: 0 auto;
   font-family: Verdana, Geneva, sans-serif;
}

/* Removes bullets and numbering from lists. */
ol, ul {
   list-style: none;
}

/* Formats the blue project heading across the top of the page. */
header {
   background: #5472B2;
   width: 100%;
   color: #FFFFFF;
   font-size: 48px;
   text-align: center;
   line-height: 1.5em;
   margin-bottom: 0;
}

/* Formats the main Wizard Works content area. */
section {
   background-color: #FFDB70;
   margin-top: 0;
   padding-bottom: 20px;
   user-select: none;
}

/* Formats the order-history heading inside the content area. */
section > h1 {
   font-size: 2em;
   text-align: center;
   margin: 0;
   padding: 20px 0;
}

/* Centers the Wizard Works logo. */
img {
   display: block;
   margin: 0 auto;
}

/* Positions the form labels in a left column. */
label {
   display: block;
   width: 200px;
   float: left;
   clear: left;
   margin: 5px 12px 12px 80px;
   text-align: right;
}

/* Positions the form inputs beside their labels. */
input {
   display: block;
   float: left;
}

/* Adds spacing before the View Orders button. */
input#viewOrders {
   display: inline-block;
   margin-left: 12px;
}

/* Formats the container that displays the returned order information. */
div#orderResult {
   border-top: 1px solid gray;
   width: 600px;
   margin: 20px auto 0;
   clear: left;
}

/* Formats the customer summary table. */
table#summary {
   margin-top: 20px;
   border-collapse: collapse;
   font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro",
      "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
}

/* Formats the heading cells in the customer summary table. */
table#summary th {
   font-weight: bold;
   text-align: left;
   width: 200px;
   padding: 4px 0;
}

/* Formats the data cells in the customer summary table. */
table#summary td {
   text-align: left;
   width: 400px;
   padding: 4px 0;
}

/* Formats each individual order table. */
table.orderList {
   margin-top: 20px;
   border-collapse: collapse;
   font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro",
      "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
}

/* Aligns the order date on the left side of the first heading row. */
table.orderList tr:nth-of-type(1) th:first-of-type {
   text-align: left;
   padding: 6px 2px;
   font-weight: bold;
}

/* Aligns the order cost on the right side of the first heading row. */
table.orderList tr:nth-of-type(1) th:last-of-type {
   text-align: right;
   padding: 6px 2px;
   font-weight: bold;
}

/* Adds a colored background to the product column headings. */
table.orderList tr:nth-of-type(2) {
   background-color: rgba(152, 151, 231, 1);
}

/* Formats the product column headings. */
table.orderList tr:nth-of-type(2) th {
   padding: 8px;
   font-size: 1.1em;
   text-align: right;
}

/* Aligns the Description heading to the left. */
table.orderList tr:nth-of-type(2) th:first-of-type {
   text-align: left;
}

/* Formats the product quantity and price cells. */
table.orderList tr td {
   text-align: right;
   padding: 4px 2px;
   width: 80px;
}

/* Formats the product description cells. */
table.orderList tr td:first-of-type {
   width: 380px;
   padding: 4px 0;
   text-align: left;
}
