/* Solarized color palette */
:root {
  /* Solarized dark colors */
  --base03: #002b36;
  --base02: #073642;
  --base01: #586e75;
  --base00: #657b83;
  --base0: #839496;
  --base1: #93a1a1;
  --base2: #eee8d5;
  --base3: #fdf6e3;
  --solar-yellow: #b58900;
  --solar-orange: #cb4b16;
  --solar-red: #dc322f;
  --solar-magenta: #d33682;
  --solar-violet: #6c71c4;
  --solar-blue: #268bd2;
  --solar-cyan: #2aa198;
  --solar-green: #859900;
}

/* Light mode (default) - Solarized Light */
body {
  font-family: Arial, sans-serif;
  margin: 40px;
  background-color: var(--base3);
  color: var(--base00);
  transition:
    background-color 0.3s,
    color 0.3s;
}

pre {
  font-family: monospace;
  background-color: var(--base2);
  color: var(--base00);
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h1,
h2,
h3 {
  color: var(--base01);
}

a {
  color: var(--solar-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 10px;
  padding: 10px;
  background-color: var(--base2);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form elements */
input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--base1);
  border-radius: 4px;
  background-color: var(--base2);
  color: var(--base00);
  font-size: 16px;
  margin-right: 10px;
  margin-bottom: 10px;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--solar-blue);
  box-shadow: 0 0 0 2px rgba(38, 139, 210, 0.2);
}

button {
  padding: 8px 16px;
  background-color: var(--solar-blue);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-right: 10px;
  margin-bottom: 10px;
  transition: background-color 0.2s;
}

button:hover {
  background-color: var(--solar-cyan);
}

button:active {
  transform: translateY(1px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Card layout for changes */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* Interval sections */
.interval-section {
  margin-bottom: 40px;
  width: 100%;
  display: block; /* Ensure interval sections stack vertically */
}

.interval-section .interval-header {
  border-bottom: 2px solid var(--solar-blue);
  padding-bottom: 10px;
  margin-bottom: 20px;
  color: var(--base01);
}

.interval-section .card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.change-card {
  background-color: var(--base2);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  padding: 15px;
  position: relative;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.change-card .hide-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  color: var(--base01);
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  margin: 0;
  width: auto;
  height: auto;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.change-card .hide-button:hover {
  opacity: 1;
  background: none;
}

body.dark-mode .change-card .hide-button {
  color: var(--base1);
}

.change-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.change-card h4 {
  margin: 0 0 10px 0;
  color: var(--base01);
  font-size: 1.1em;
}

.change-card .project-name {
  font-weight: bold;
  color: var(--solar-blue);
  margin-bottom: 8px;
}

.change-card .subject {
  margin-bottom: 10px;
  line-height: 1.4;
}

.change-card .review-state {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  background-color: var(--solar-yellow); /* Using yellow for review state */
  color: white;
  margin-bottom: 10px;
}

.change-card .gerrit-link {
  display: inline-block;
  padding: 3px 8px;
  background-color: var(--solar-blue); /* Using blue for the button */
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  margin-top: 10px;
}

.change-card .gerrit-link:hover {
  background-color: var(--solar-cyan); /* Using cyan on hover */
  opacity: 0.9;
  text-decoration: none;
}

/* Change stats box */
.change-stats {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  background-color: var(--base3); /* Light page background */
  color: var(--base00); /* Dark text */
  margin-top: 10px;
  float: right;
}

.change-stats .insertions {
  color: var(--solar-green); /* Green for insertions */
}

.change-stats .deletions {
  color: var(--solar-red); /* Red for deletions */
}

/* Dark mode stats box */
body.dark-mode .change-stats {
  background-color: var(--base03); /* Dark page background */
  color: var(--base0); /* Light text */
}

body.dark-mode .change-stats .insertions {
  color: var(--solar-green); /* Green for insertions */
}

body.dark-mode .change-stats .deletions {
  color: var(--solar-red); /* Red for deletions */
}

.change-card ul.time-intervals {
  list-style-type: disc;
  padding-left: 20px;
}

.change-card ul.time-intervals li {
  background: none;
  box-shadow: none;
  padding: 2px 0;
  margin-bottom: 0;
}

/* Responsive card layout */
@media (min-width: 1200px) {
  /* Large screens - exactly 3 cards wide */
  .card-container,
  .interval-section .card-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  /* Medium screens - up to 2 cards wide */
  .card-container,
  .interval-section .card-container {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 767px) {
  /* Small screens/mobile - 1 card wide */
  .card-container,
  .interval-section .card-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Dark mode card colors */
body.dark-mode .change-card .review-state {
  background-color: var(--solar-yellow);
  color: var(--base3);
}

body.dark-mode .change-card .gerrit-link {
  background-color: var(--solar-blue);
  color: var(--base3);
}

body.dark-mode .change-card .gerrit-link:hover {
  background-color: var(--solar-cyan);
}

/* Dark mode form elements */
body.dark-mode input[type="text"] {
  background-color: var(--base02);
  color: var(--base0);
  border-color: var(--base01);
}

body.dark-mode input[type="text"]:focus {
  border-color: var(--solar-blue);
  box-shadow: 0 0 0 2px rgba(38, 139, 210, 0.3);
}

body.dark-mode button {
  background-color: var(--solar-blue);
  color: var(--base3);
}

body.dark-mode button:hover {
  background-color: var(--solar-cyan);
}

/* Dark mode - Solarized Dark */
body.dark-mode {
  background-color: var(--base03);
  color: var(--base0);
}

body.dark-mode pre {
  background-color: var(--base02);
  color: var(--base0);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: var(--base1);
}

body.dark-mode li {
  background-color: var(--base02);
  color: var(--base0);
}

body.dark-mode .change-card {
  background-color: var(--base02);
  color: var(--base0);
}

body.dark-mode .change-card h4 {
  color: var(--base1);
}

/* Company-specific changes */
.change-card.company-change {
  border-left: 4px solid var(--solar-orange);
  display: none;
}

body.dark-mode .change-card.company-change {
  border-left: 4px solid var(--solar-orange);
}

/* Header button styles */
.header {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  gap: 10px;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.header button {
  background-color: var(--base2);
  border: 1px solid var(--base1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
  margin: 0;
}

body.dark-mode .header button {
  background-color: var(--base02);
  border: 1px solid var(--base01);
  color: var(--base1);
}

/* Twisty buttons for collapsible sections */
.twisty {
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
  width: 16px; /* Fixed size square */
  height: 16px; /* Fixed size square */
  border-radius: 0;
  box-shadow: none;
  color: inherit !important; /* Same color as parent text */
  vertical-align: middle;
  position: relative;
  font-size: 0; /* Hide any text content */
}

/* Create down-facing triangle using CSS */
.twisty::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor; /* Use current text color */
}

/* Create right-facing triangle when collapsed */
.twisty.collapsed::before {
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid currentColor;
  border-right: none;
}

.twisty:hover {
  background: none !important;
  transform: none;
}

/* Dark mode override for twisty buttons */
body.dark-mode .twisty {
  background: none !important;
  color: inherit !important;
  border: none !important;
}

body.dark-mode .twisty:hover {
  background: none !important;
  color: inherit !important;
}

/* Additional styles for the main content to avoid overlap with fixed header */
.container {
  margin-top: 60px;
}
