.case-study {
  margin: 0 auto;
  text-align: left;
  margin: 0rem 6rem;
}
  
/* Case Study Content Layout */
.case-study-content {
  display: flex;
  gap: 4rem;
}

.case-study-content .main-content {
  flex: 1;
  min-width: 0;
}

.section {
  padding: 1.5rem 0;
  width: 100%;
}

.section:first-child {
  margin-top: 0;
}

@media (max-width: 1200px) {
  .case-study-content {
    display: block;
    max-width: 800px;
  }
}

/* Typography */
.dark-mode .link{
  color: rgb(108, 183, 208);
  text-decoration: underline;
}
img {
  max-width: 100%;
  object-fit: contain;
}

h2 {
  font-weight: normal;
  font-size: 2.25rem;
  margin: 2rem 0 1.5rem;
  color: var(--text-color);
}

h3 {
  font-size: 1.75rem;
  font-weight: normal;
  margin: 1.5rem 0 1rem;
  color: var(--text-color);
}

h4 {
  text-align: left;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

p {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  max-width: 100%;
}

ul, ol, tr, td, th {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.problems-list {
  margin-top: 1rem;
}

ul:not(.nav-list){
  padding-left: 1.5rem;
}
li:not(.nav-list) {
  /* list-style: none; */
  margin-bottom: 1rem;
  position: relative;
}

/* Content sections */
.callout {
  background-color: var(--primary-color);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
  max-width: 100%;
  box-shadow: var(--box-shadow);
  user-select: text;
}

.callout p {
  margin-bottom: 0;
  user-select: text;

}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.example-card {
  background-color: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  cursor: url('/assets/pointer.png'), auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sketches-grid {
  display: grid;
  margin: 2rem;
}

.sketch-card {
  background-color: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  cursor: url('/assets/pointer.png'), auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 2rem;
  padding: 1rem;
}

.sketches-grid p{
  color: black;
  text-align: center;
  vertical-align: center;
  padding-top: 1rem;
  font-size: 1.5rem;
  margin-bottom: 0;
}

/* Modal overlay for expanded view */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  border-radius: 8px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  animation: zoomIn 0.3s forwards;
}

  .modal-overlay.active .modal-content {
    transform: scale(1);
  }

  .modal-image {
    display: block;
    width: 100%;
    height: auto;
  }
  .modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: url('/assets/pointer.png'), auto;
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
  }
}

.example-card:focus {
  outline: 3px solid #0072ff;
}

.modal-close:focus {
  outline: 3px solid #0072ff;
  box-shadow: 0 0 0 3px rgba(0, 114, 255, 0.3);
}

.example-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--box-shadow);
} 

.example-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
  margin-bottom: 0;
}

.example-card p {
  padding: 1rem;
  margin: 0;
  font-size: 1.5rem;
  text-align: center;
  background-color: var(--bg);
}

/* Analysis sections */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.analysis-column {
  background-color: var(--bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  min-height: 300px;
}

/* State Models */
.state-model-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.state-model {
  background-color: rgb(255, 255, 255);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
}

.state-model .dark-mode {
  background-color: rgb(224, 224, 224);
}

.state-model-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: black;
}

.state-model-diagram {
  width: 100%;
  margin: 1.5rem 0;
}

.diagram-image {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

.state-model-description p {
  margin-bottom: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: black;
}

/* Redesign Section - generic for any component */
.redesign-section {
  margin: 3rem 0;
}

.redesign-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin: 2rem 0;
}

.original, .redesigned {
  width: 100%;
}

.component-header {
  margin-bottom: 2rem;
}

.component-header h3 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--text-color);
}

.component-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.component-mockup {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.component-features h4 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--border-radius);
}

.modal-image {
  max-width: 100%;
  max-height: calc(90vh - 100px);
  object-fit: contain;
}

.modal-caption {
  text-align: center;
  margin: 1rem 0 0;
  color: var(--text-color);
  font-size: 1.1rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255);
  border-radius: 50%;
  font-size: 32px;
  cursor: url('/assets/pointer.png'), auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  z-index: 1001;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: normal;
  transition: font-weight 0.2s ease;
}

.modal-close:hover {
  font-weight: bold;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  background: white;
  border: none;
  border-radius: 4px;
  font-size: 48px;
  cursor: url('/assets/pointer.png'), auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-weight: normal;
  transition: font-weight 0.2s ease;
}

.modal-nav:hover {
  font-weight: bold;
}

.modal-nav.prev {
  left: -60px;
}

.modal-nav.next {
  right: -60px;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);

}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg);
}

th, td {
  padding: 1.25rem;
  text-align: left;
  /* border: 1px solid var(--light-text); */
  vertical-align: top;
}

th {
  background-color: var(--accent-color2);
  color: var(--text-color);
  font-weight: 600;
}

td {
}

/* Hero banner styles */
.case-study-hero {
  display: flex;
  justify-content: center;
  align-items: start;
  padding-top: 2rem;
  margin-bottom: 3rem;
}

.hero-container {
  width: 100%;
  max-width: 3000px;
  overflow: hidden;
  border-radius: 8px;
  border: 3px solid #333;
  background-color: var(--accent-color2);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: var(--accent-color2);
  border-bottom: 3px solid #333;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--text-color);
  margin: 0;
}

.hero-controls {
  display: flex;
  gap: 1.5rem;
}

.hero-control-icon {
  width: 24px;
  height: 24px;
}

.hero-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-description {
  text-align: center;
  color: var(--med-text);
  max-width: 1000px;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.4;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 3rem;
  font-size: 1.5rem;
  color: #333;
}

.hero-button {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  color: #333;
  font-weight: 500;
  border: 3px solid var(--text-color);
  background-color: var(--accent-color2);
  cursor: url('/assets/pointer.png'), auto;
  font-size: 1.25rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.hero-button:hover {
  background-color: var(--accent-color2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .case-study {
    padding: 0 1rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  p {
    font-size: 1.1rem;
  }

  .state-model {
    padding: 1.5rem;
  }
  
  .state-model-title {
    font-size: 1.25rem;
  }
  
  .state-model-description p {
    font-size: 1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-description {
    font-size: 1.2rem;
  }

  .hero-meta {
    flex-direction: column;
    gap: 1rem;
    font-size: 1.2rem;
  }
  
  .redesign-container {
    gap: 3rem;
  }
  
  .component-header h3 {
    font-size: 1.5rem;
  }
  
  .component-features .bullet-list li {
    font-size: 1.1rem;
  }

  .table-container {
    overflow-x: scroll;
  }
}

.case-study-nav {
  position: sticky;
  top: 2rem;
  width: 240px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: sticky;
  padding: 1rem;
  margin: 0;
}

.case-study-nav ul {
  list-style: none;
  padding: 0;
}

.case-study-nav li {
  margin-bottom: 0rem;
}

.case-study-content .case-study-nav ul li::before {
  content: none;
}

.case-study-nav a {
  color: #777;
  text-decoration: none;
  font-size: 1.5rem;
  display: block;
  padding: 0.5rem;
  padding-left: 0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.case-study-nav a:hover,
.case-study-nav a:focus {
  color: var(--text-color);
  padding-left: 1rem;
  outline: none;
}

.case-study-nav a.active {
  color: var(--active-color);
  background-color: var(--active-bg);
  font-weight: 500;
  padding-left: 1rem;
}

@media (max-width: 1200px) {
  .case-study-nav {
    display: none;
  }
}

.figma-embed {
  width: 100%;
  height: 500px;
  margin: 2rem 0;
}
.wireframe-images img,
.examples-grid img {
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 1rem 0;
}

.sketch-image img {
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto;
  display: block;
}
.before-after {
  display: flex;
  margin-bottom: 1rem;
}

.before,
.after {
  flex: 1;
  padding: 1rem;
}

@media (max-width: 900px) {
  .case-study-banner {
    display: none;
  }
}

@media (max-width: 700px) {
  .case-study {
    margin: 2rem;
    margin-top: 0;
  }
}