/* ============================================================================
   Case Sharing Page - Mobile First Design
   ========================================================================== */

/* Background Decorations */
.bg-decoration {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  top: 0;
  left: 0;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: var(--secondary-color);
  top: -100px;
  right: -50px;
  animation: float 20s infinite alternate;
}

.circle-2 {
  width: 350px;
  height: 350px;
  background: var(--primary-color);
  bottom: -100px;
  left: -50px;
  opacity: 0.2;
  animation: float 25s infinite alternate-reverse;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(40px, 60px);
  }
}

/* Base Mobile Styles */
body {
  overflow-x: hidden;
}

/* Hero Section - Mobile First */
.hero-section {
  padding: 2rem 0 1.5rem;
  position: relative;
}

.hero-section .container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero-section h3 {
  color: var(--secondary-color-mid);
  letter-spacing: 2px;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.hero-section h1 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.divider {
  width: 50px;
  height: 3px;
  background: var(--secondary-color);
  margin-top: 0.75rem;
  border-radius: 2px;
}

/* Main Layout - Mobile First */
.main-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 1.5rem;
}

.layout-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar Navigation - Mobile First */
.sidebar {
  width: 100%;
  order: 1;
}

.nav-list-wrapper {
  overflow-x: scroll;
  overflow-y: hidden;
  padding: 0 1rem 1rem;
}

.nav-list-wrapper::-webkit-scrollbar {
  height: 6px;
}

.nav-list-wrapper::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 3px;
}

.nav-list-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color-mid);
  border-radius: 3px;
}

.nav-list-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--secondary-color);
}

.nav-list {
  display: flex;
  gap: 1rem;
  width: max-content;
}

.nav-item {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-left: 4px solid transparent;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  flex: 0 0 240px;
}

.nav-item:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.nav-item.active {
  border-left-color: var(--secondary-color);
  background: linear-gradient(to right, var(--white), white);
  box-shadow: 0 10px 40px -10px rgba(0, 95, 115, 0.15);
}

.nav-cat {
  font-size: 0.75rem;
  color: var(--secondary-color-mid);
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

.nav-title {
  font-size: 0.95rem;
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
}

/* Detail Card - Mobile First */
.content-area {
  position: relative;
  width: 100%;
  padding: 0 1rem;
  order: 2;
}

.detail-card {
  background: white;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.5);
  min-height: 500px;
}

.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.case-detail {
  display: none;
  flex-direction: column;
  height: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.case-detail[style*="display: block"] {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
  animation: slideInUp 0.6s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meta-header {
  margin-bottom: 1rem;
}

.category-badge {
  background: var(--primary-color);
  color: white;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  font-weight: 500;
  display: inline-block;
}

.case-title {
  font-size: 1.5rem;
  color: var(--primary-color-dark);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.scrollable-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  padding-bottom: 1rem;
}

.scrollable-body::-webkit-scrollbar {
  width: 0;
}

.section-block {
  margin-bottom: 1.5rem;
}

.section-block h4 {
  color: var(--secondary-color-alt);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--bg-light);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.section-block p {
  color: var(--text-body);
  line-height: 1.7;
  font-size: 0.95rem;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.quote-wrapper {
  margin-top: auto;
  background: linear-gradient(135deg, var(--accent-color) 0%, #fff5d6 100%);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  color: var(--text-heading);
  box-shadow: 0 10px 30px rgba(255, 229, 160, 0.4);
  border: 2px solid rgba(255, 200, 87, 0.3);
  overflow: hidden;
}

.quote-wrapper::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.quote-content {
  position: relative;
  padding-left: 0;
}

.quote-content p {
  font-family: serif;
  font-style: italic;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #444;
  position: relative;
  z-index: 1;
  line-height: 2;
}

.quote-author {
  display: block;
  text-align: right;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary-color);
  position: relative;
  z-index: 1;
}

.quote-author::before {
  content: "—";
  margin-right: 0.5rem;
  opacity: 0.6;
}

/* ============================================================================
   Tablet & Desktop Styles (min-width)
   ========================================================================== */

/* Tablet - 768px and up */
@media (min-width: 768px) {
  .circle-1 {
    width: 500px;
    height: 500px;
    top: -150px;
    right: -75px;
  }

  .circle-2 {
    width: 450px;
    height: 450px;
    bottom: -125px;
    left: -75px;
  }

  .hero-section {
    padding: 2.5rem 0 2rem;
  }

  .hero-section .container {
    padding: 0 2rem;
  }

  .hero-section h3 {
    font-size: 0.85rem;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .divider {
    width: 60px;
    height: 4px;
    margin-top: 1rem;
  }

  .main-container {
    padding: 0 0 2rem;
  }

  .layout-grid {
    gap: 2rem;
  }

  .nav-list-wrapper {
    padding: 0 2rem 1rem;
  }

  .nav-item {
    padding: 1.25rem;
    flex: 0 0 280px;
  }

  .nav-cat {
    font-size: 0.8rem;
  }

  .nav-title {
    font-size: 1.05rem;
  }

  .content-area {
    padding: 0 4rem;
  }

  .detail-card {
    padding: 2rem;
    border-radius: 20px;
    min-height: 600px;
  }

  .case-title {
    font-size: 1.8rem;
  }

  .section-block {
    margin-bottom: 2rem;
  }

  .section-block h4 {
    font-size: 0.9rem;
  }

  .section-block p {
    font-size: 1rem;
    line-height: 1.75;
  }

  .grid-2-col {
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .quote-wrapper {
    padding: 2rem;
    border-radius: 18px;
  }

  .quote-content p {
    font-size: 1.1rem;
  }

  .quote-author {
    font-size: 0.9rem;
  }
}

/* Desktop - 1025px and up */
@media (min-width: 1025px) {
  .circle-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -100px;
  }

  .circle-2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -100px;
  }

  .hero-section {
    padding: 3rem 0 2rem;
  }

  .hero-section .container {
    padding: 0 4rem;
  }

  .hero-section h3 {
    font-size: 0.9rem;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }

  .main-container {
    padding: 0 4rem 3rem;
  }

  .layout-grid {
    gap: 3rem;
  }

  .nav-list-wrapper {
    padding: 0 2rem 1rem;
  }

  .nav-item {
    padding: 1.5rem;
    flex: 0 0 320px;
  }

  .nav-cat {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }

  .nav-title {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  .content-area {
    padding: 0 4rem;
  }

  .detail-card {
    padding: 3rem;
    border-radius: 24px;
    min-height: 650px;
  }

  .category-badge {
    padding: 8px 18px;
    font-size: 0.95rem;
  }

  .meta-header {
    margin-bottom: 1.5rem;
  }

  .case-title {
    font-size: 2.2rem;
    margin-bottom: 2.25rem;
    line-height: 1.4;
  }

  .scrollable-body {
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .section-block {
    margin-bottom: 2.25rem;
  }

  .section-block h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .section-block p {
    font-size: 1.1rem;
    line-height: 1.85;
  }

  .grid-2-col {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.25rem;
  }

  .quote-wrapper {
    padding: 2.5rem;
    margin-top: 2rem;
    border-radius: 20px;
  }

  .quote-wrapper::before {
    width: 250px;
    height: 250px;
  }

  .quote-content p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .quote-author {
    font-size: 1rem;
  }
}

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
  body {
    overflow-x: auto;
  }

  .main-container {
    min-height: calc(100vh - 400px);
    display: flex;
    flex-direction: column;
  }

  .layout-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 4.5rem;
    flex: 1;
    min-height: 600px;
  }

  .sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    order: 0;
    width: auto;
  }

  .nav-list-wrapper {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 1.5rem 0 0;
  }

  .nav-list-wrapper::-webkit-scrollbar {
    width: 4px;
    height: auto;
  }

  .nav-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav-list-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color-mid);
    border-radius: 4px;
  }

  .nav-list {
    display: block;
    width: auto;
  }

  .nav-item {
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    flex: none;
    width: auto;
  }

  .nav-item:hover {
    transform: translateX(5px);
  }

  .content-area {
    height: 100%;
    padding: 0;
    order: 0;
  }

  .detail-card {
    height: 100%;
    padding: 4rem;
  }

  .case-title {
    font-size: 2.4rem;
    margin-bottom: 2.5rem;
  }

  .section-block {
    margin-bottom: 2.5rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .circle-1,
  .circle-2 {
    animation: none;
  }
}

/* Print */
@media print {
  .bg-decoration,
  .nav-list-wrapper {
    display: none;
  }

  .layout-grid {
    grid-template-columns: 1fr;
  }

  .detail-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
