/**********************************************************************
******                      General Formatting                    ******
**********************************************************************/
:root {
  --navbar-height: 60px;
  overflow-x: hidden;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, hsl(0, 0%, 15%) 0%, #292929 100%);
  min-height: 100vh;
  color: #333;
}

/**********************************************************************
******                      Header Formatting                     ******
**********************************************************************/
.header-container {
  margin-top: var(--navbar-height);
  text-align: center;
  margin-bottom: 40px;
  padding: 60px 20px 40px 20px;
}

.title {
  text-align: center;
  font-size: 5rem;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  color: rgb(214, 214, 214);
  background-clip: text;
  position: relative;
  display: inline-block;
  width: 100%;
  overflow: visible;
}

.subtitle {
  color: rgb(180, 180, 180);
  margin-top: -10px;
}

/**********************************************************************
******                      Controls Section                       ******
**********************************************************************/
.controls {
  display: flex;
  flex-wrap: wrap;            /* allow wrapping instead of overlap */
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 50px 30px 50px;
}

/* Search column grows first; wraps when too small */
.left-controls {
  flex: 1 1 420px;            /* grow, but wrap if narrower than ~420px */
  min-width: 260px;           /* usable floor to prevent squish */
}

/* Filters stay to the right and do not shrink into search */
.right-controls {
  flex: 0 0 auto;
  margin-left: auto;          /* pin to the right edge on wide screens */
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-bar {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  background: linear-gradient(135deg, #1c0101, #2F0101);
  backdrop-filter: blur(10px);
  border: 2px solid rgb(29, 0, 0);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  color: rgb(214,214,214);
}
.search-bar:focus {
  outline: none;
  background: linear-gradient(135deg, #2e0101, #3f0101);
  transform: scale(1.02);
}
.search-bar::placeholder {
  color: rgba(255,255,255,0.7);
}

.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: linear-gradient(-135deg, #1c0101, #2F0101);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border: 2px solid rgb(29, 0, 0);
  border-radius: 25px;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: rgb(214, 214, 214);
  gap: 10px;
  min-width: 175px;
  display: flex;
  align-items: center;
  justify-content: flex-end;  /* keep label right-aligned in the pill */
  transition: all 0.3s ease;
}
.dropdown-btn:hover {
  outline: none;
  background: linear-gradient(-135deg, #2e0101, #3f0101);
  transform: scale(1.02);
}

/* Truncate long selected labels inside the button without overflow */
.dropdown-btn span#selectedSort {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: right;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: rgb(54, 54, 54);
  min-width: 250px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  border-radius: 15px;
  z-index: 1;
  top: 100%;
  margin-top: 5px;
  overflow: hidden;
  right: 0;
}
.dropdown-content.show {
  display: block;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-option {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
  color: rgb(214,214,214);
  border-bottom: 1px solid #5f5f5f;
}
.dropdown-option:last-child {
  border-bottom: none;
}
.dropdown-option:hover {
  background: linear-gradient(45deg, #4a0000c8, #520000a0);
  color: rgb(214, 214, 214);
}

.btn {
  background: linear-gradient(-135deg, #1c0101, #2F0101);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border: 2px solid rgb(29, 0, 0);
  color: rgb(214, 214, 214);
  border-radius: 25px;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn:hover {
  outline: none;
  background: linear-gradient(-135deg, #2e0101, #3f0101);
  transform: scale(1.02);
}

/**********************************************************************
******                          Job Cards                          ******
**********************************************************************/
.job-container {
  margin: 0 50px;
}

.job-card {
  background: #1c0101;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  margin-bottom: 30px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.job-card:hover {
  transform: translateY(-10px) scale(1.01);
}

.fade-in {
  animation: fadeIn 0.6s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.job-header {
  padding: 25px;
  background: #1c0101;
  position: relative;
  overflow: hidden;
}
.job-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 7px;
  background: #2f0101;
}

.job-main-info {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: start;
}

.job-title-section h3 {
  color: rgb(214, 214, 214);
  margin-bottom: 2px;
  font-size: 1.6em;
}

.job-title-section h4 {
  margin-bottom: 8px;
  font-size: 1.3em;
  color: #666;
}

.job-meta-list {
  padding-left: 20px;
  color: rgb(214,214,214);
  font-size: 1.2em;
}

.job-dates-section {
  text-align: right;
}

.job-dates {
  background: linear-gradient(135deg, #2e0101, #3f0101);
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}

.employment-duration {
  display: block;
  background: rgba(255,255,255,0.127);
  border: 1px solid rgba(28,1,1,0.401);
  color: rgb(214,214,214);
  padding: 8px 16px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  min-width: 0;
  margin-left: auto;
  margin-right: 0;
}

/**********************************************************************
******                       Info-Card Styles                      ******
**********************************************************************/
.info-card-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.info-card-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.info-card {
  background-color: rgba(30, 30, 35, 1);
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);

  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.info-card-overlay.active .info-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.info-card-header {
  background: rgba(28, 1, 1, 0.9);
  color: rgb(214, 214, 214);
  padding: 30px;
  position: relative;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.info-card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 300px;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  pointer-events: none;
}

.info-card-header h2 {
  margin: 0 0 5px 0;
  font-size: 1.8em;
}
.info-card-header h3 {
  margin: 0;
  font-size: 1.2em;
  opacity: 0.9;
}

.info-card-body {
  padding: 30px;
}

.info-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.info-card-meta-item {
  background: linear-gradient(135deg, #1c0101, #2F0101);
  border: 2px solid rgba(28, 1, 1, 0.401);
  color: rgb(190, 190, 190);
  border-radius: 20px;
  padding: 20px;
}
.info-card-label {
  font-weight: 700;
  margin-bottom: 6px;
}
.info-card-value {
  opacity: 0.9;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}
.status-completed { background: rgba(34,197,94,0.1); color: #22c55e; }
.status-current   { background: rgba(59,130,246,0.1); color: #3b82f6; }

.section-title {
  font-size: 1.3em;
  color: rgb(214, 214, 214);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #450000;
}

.summary-text {
  line-height: 1.5;
  color: rgb(214,214,214);
  margin-top: 10px;
  margin-bottom: 30px;
}

.achievements {
  line-height: 1.7;
  color: rgb(214,214,214);
  margin-top: 10px;
  margin-bottom: 30px;
  margin-left: 18px;
}

/**********************************************************************
******                         Responsive                          ******
**********************************************************************/
@media (max-width: 900px) {
  .job-title-section h3 {
    font-size: 1.4em;
  }

  .job-title-section h4 {
    font-size: 1.1em;
  }

  .job-meta-list {
    font-size: 1.1em;
  }
}

@media (max-width: 860px) {
  /* stack controls nicely when narrower */
  .controls {
    gap: 12px;
  }
  .left-controls {
    flex: 1 1 100%;
  }
  .right-controls {
    width: 100%;
    justify-content: flex-end;  /* filters on the next line, right-aligned */
  }
}

@media (max-width: 768px) {
  .header-container {
    margin-top: 20px;
    margin-bottom: 40px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  .left-controls { max-width: none; }
  .right-controls { justify-content: center; }
  .job-main-info {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .job-dates-section {
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .employment-duration {
    margin-left: 0;
  }
  .job-meta-grid {
    grid-template-columns: 1fr;
  }
  .info-card {
    width: 90%;
  }
  .info-card-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    pointer-events: none;
  }
}

@media (max-width: 550px) {
  .header-container {
    margin-top: 20px;
    margin-bottom: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .title {
    font-size: 4rem;
  }
  .info-card {
    width: 85%;
  }
  .controls {
    margin-left: 10px;
    margin-right: 10px;
  }
  .job-container {
    margin-left: 10px;
    margin-right: 10px;
  }
  .job-meta-list {
    font-size: 0.9em;
  }
}

@media (max-width: 400px) {
  .header-container {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-top: 10px;
    padding-bottom: 15px;
  }
  .title {
    font-size: 3rem;
  }
  .subtitle {
    margin-top: -5px;
    font-size: 0.8rem;
  }

  .dropdown-content {
    min-width: 200px;
    font-size: 0.8rem;
  }
}
