/* Resetting default margins and padding... */
* {
  padding: 0;
  margin: 0;
  /* Adding box-sizing for easier sizing management */
  box-sizing: border-box;
}

/* Setting up base body styles for better readability... */
body {
  /* Using a very dark gray for text, which is softer than pure black but high contrast */
  color: #1a1a1a;
  /* Explicitly setting font family to a highly readable sans-serif stack */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Increasing base font size significantly for older readers */
  font-size: 24px;
  /* Adding line height to give text more breathing room */
  line-height: 1.6;
  padding: 40px 20px; 
  background: #f4f4f4; 
}

/* Styling headings for clear visual hierarchy... */
h1 {
  text-align: center;
  padding: 30px 0 20px 0;
  margin: 0;
  /* Larger size for main heading */
  font-size: 40px;
  color: #000; 
  font-weight: 700;
}

h2 {
  font-size: 30px;
  text-align: center;
  padding: 20px 0;
  color: #333;
  font-weight: 600;
}

/* Configuring the main container... */
#container {
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  position: relative;
  background: #ffffff;
  max-width: 1200px; 
  margin: 0 auto; 
  border-radius: 12px; /* Slightly more rounded for a softer, modern look */
  overflow: hidden; 
  padding: 30px; /* Increased padding for the large view */
}

/* Styling the table structure for clarity... */
table {
  background-color: #ffffff;
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
}

/* Styling table headers with high contrast... */
th {
  background-color: #004b87;
  color: #ffffff;
  cursor: pointer;
  padding: 20px 25px; /* Larger padding for touch targets */
  font-weight: bold;
  font-size: 28px; /* Slightly larger headers */
  border-bottom: 2px solid #002e52; 
  text-align: right; /* RTL alignment */
}

/* Fix width distribution for 2 columns */
th:first-of-type {
  width: 70%;
}
th:last-of-type {
  width: 30%;
}

th small {
  font-size: 20px;
  font-weight: normal;
  opacity: 0.9; 
}

td {
  text-align: right; /* RTL alignment */
  vertical-align: middle;
}

/* Improving link visibility and touch targets... */
a {
  text-decoration: underline; 
  text-underline-offset: 4px; 
}

td a {
  color: #0056b3;
  display: block;
  padding: 20px 25px; /* Substantial padding to make the entire cell area clickable */
  font-weight: 500;
}

th a {
  padding: 0;
  color: #ffffff; 
}

/* Configuring icons and spacing for the first column (RTL Adjusted) */
td:first-of-type a {
  background: url(./.images/file.png) no-repeat right 25px center;
  background-size: 36px 36px; /* Larger icons */
  padding-right: 75px; /* Make room for the icon on the right */
  padding-left: 20px;
  min-height: 70px; 
}

th:first-of-type {
  padding-right: 75px;
  padding-left: 20px;
}

td:not(:first-of-type) a {
  background-image: none !important;
}

/* Setting up alternating row colors for easier tracking... */
tr:nth-of-type(odd) td {
  background-color: #f9f9f9;
}

tr:nth-of-type(even) td {
  background-color: #ffffff;
}

tr td {
  border-bottom: 1px solid #e0e0e0;
}

/* Enhancing hover states for clear feedback... */
tr:hover td {
  background-color: #e6f2ff;
}

tr:hover td a {
  color: #003d82;
  text-decoration: none; 
}

/* Applying specific icons based on file type... */
table tr td:first-of-type a[href$=".jpg"],
table tr td:first-of-type a[href$=".png"],
table tr td:first-of-type a[href$=".gif"],
table tr td:first-of-type a[href$=".svg"],
table tr td:first-of-type a[href$=".jpeg"] {
  background-image: url(./.images/image.png);
}

table tr td:first-of-type a[href$=".zip"] {
  background-image: url(./.images/zip.png);
}

table tr td:first-of-type a[href$=".css"] {
  background-image: url(./.images/css.png);
}

table tr td:first-of-type a[href$=".doc"],
table tr td:first-of-type a[href$=".docx"],
table tr td:first-of-type a[href$=".ppt"],
table tr td:first-of-type a[href$=".pptx"],
table tr td:first-of-type a[href$=".pps"],
table tr td:first-of-type a[href$=".ppsx"],
table tr td:first-of-type a[href$=".xls"],
table tr td:first-of-type a[href$=".xlsx"] {
  background-image: url(./.images/office.png);
}

table tr td:first-of-type a[href$=".avi"],
table tr td:first-of-type a[href$=".wmv"],
table tr td:first-of-type a[href$=".mp4"],
table tr td:first-of-type a[href$=".mov"],
table tr td:first-of-type a[href$=".m4a"] {
  background-image: url(./.images/video.png);
}

table tr td:first-of-type a[href$=".mp3"],
table tr td:first-of-type a[href$=".ogg"],
table tr td:first-of-type a[href$=".aac"],
table tr td:first-of-type a[href$=".wma"] {
  background-image: url(./.images/audio.png);
}

table tr td:first-of-type a[href$=".html"],
table tr td:first-of-type a[href$=".htm"],
table tr td:first-of-type a[href$=".xml"] {
  background-image: url(./.images/xml.png);
}

table tr td:first-of-type a[href$=".php"] {
  background-image: url(./.images/php.png);
}

table tr td:first-of-type a[href$=".js"] {
  background-image: url(./.images/script.png);
}

table tr.dir td:first-of-type a {
  background-image: url(./.images/folder.png);
}
