/* styles-modern.css */
/* Modernized patch CSS: Non-breaking layout enhancements and mobile compatibility */

/* === Root Variables for Color Theme and Sizing === */
:root {
  --primary-bg: #f9fafb;
  --primary-text: #1f2937;
  --primary-font-size: 0.85rem;
  --accent: #3e88f7;
  --accent-light: #3e88f7;
  --accent-dark: #2563eb;
  --header-bg: #2c3e50;
  --subheader-bg: #34495e;
  --white: #ffffff;
  --border-radius: 0.5rem;
  --transition: 0.2s ease-in-out;
  --font-sans: "Inter", system-ui, sans-serif;
}

/* === Base Enhancements === */
body {
  font-family: var(--font-sans);
  font-size: var(--primary-font-size);
  color: var(--primary-text);
  background-color: var(--primary-bg);
}

/* === Layout Responsiveness === */
#container {
  width: 90%;
  max-width: 1200px;
  min-width: auto;
  margin: 0 auto;
  padding: 1rem;
}

/* === Header Styling Update === */
#header {
  background-color: var(--header-bg);
  color: var(--white);
  padding: 1rem 0;
}

#sub_header {
  background-color: var(--subheader-bg);
  color: var(--white);
  padding: 0.5rem 0;
}

#title h1 {
  font-size: 2.5rem;
}

#user-tools,
#sub_header {
  font-size: var(--primary-font-size);
}

#header button,
#sub_header button {
  font-size: inherit;
}

:is(#header, #sub_header) :is(a, button):hover {
  color: var(--accent);
}

/* === Modern Form Input Enhancements === */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
textarea,
select {
  border: 1px solid #ccc;
  padding: 0.5rem;
  border-radius: var(--border-radius);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"] {
  width: 100%;
}

select {
  max-width: 100%;
}

input[type="file"] {
  cursor: pointer;
}

input[type="submit"],
input[type="button"] {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background-color var(--transition);
  border-radius: var(--border-radius);
}

input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: var(--accent-dark);
}

label {
  float: none;
  width: 100%;
  display: block;
  margin-bottom: 0.3rem;
}

/* === Improve Task List/Solution Upload === */

#solution_upload > div:has(.left, .right),
#task_list > div:has(.left, .right) {
  display: flex;
  flex-wrap: wrap;
}

#solution_upload div.right,
#task_list div.right {
  padding-left: 0;
}

#solution_upload div.left,
#task_list div.left {
  padding-right: 0;
}

/* Left/right sections - default desktop layout */
.left, .right {
  flex: 1;
  min-width: 300px;
}

.left {
  order: 1;
}

.right {
  order: 2;
}

/* === Tables: More Responsive === */
table {
  width: 100%;
  overflow-x: auto;
  display: block;
  border-spacing: 0;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

table:not(.highlighttable) tr:hover {
  background-color: #f1f5f9; /* Slightly darker gray */
}

/* === Notifications Modernized === */
.notification {
  border-left: 4px solid var(--accent);
  background-color: #e0f2fe;
  padding: 1rem;
  border-radius: var(--border-radius);
  color: #0c4a6e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification .ui-icon {
  flex-shrink: 0;
}

/* === Misc Cleanup === */
.hidden {
  display: none !important;
}

.fullscreen {
  overflow: hidden;
}

/* === Accessibility Improvement === */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:active {
  color: var(--accent-light);
  background-color: rgba(62, 136, 247, 0.1);
}

/* Make side-by-side layout responsive */
@media (max-width: 768px) {
  .left, .right {
    flex: 0 0 100%; /* Force full width */
    min-width: 100%;
  }

  :is(#task_list, #solution_upload) :is(div.left, div.right) {
    padding: 0;
  }

  #user-tools {
    float: none;
    padding: 1rem 0;
    text-align: center;
  }

  #title h1 {
    float: none;
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  #login #form {
    width: 100%;
  }

  #login input[type="text"],
  #login input[type="password"],
  #login input[type="submit"] {
    width: 100%;
    box-sizing: border-box;
  }
}
