/*
 * Shared stylesheet for the unified LYRN website
 * Includes Theme Engine, Layout, and RWI Builder Styles
 */

/* =========================================
   THEME VARIABLES
   ========================================= */
:root {
  --bg-core: #050505;
  --bg-panel: #0a0a0a;
  --bg-input: #050505; 
  --brand-purple: #7c5cff;
  --brand-purple-dim: rgba(124, 92, 255, 0.1);
  --brand-purple-glow: rgba(124, 92, 255, 0.5);
  --text-head: #ffffff;
  --text-body: #b0b0b0;
  --text-dim: #666666;
  --border-color: #222222;
  --code-bg: #000000;
  --code-border: #333333;
  --input-focus-bg: #111111;
  --success-color: #10B981;
  --error-color: #EF4444;

  --btn-text: #e0e0e0;
  --btn-border: #444444;
  --btn-bg: rgba(255,255,255,0.03);
}

/* Light mode overrides */
body[data-theme="light"] {
  --bg-core: #eef0f4; 
  --bg-panel: #ffffff;
  --bg-input: #f4f4f6; 
  --brand-purple: #6a4ce0; 
  --brand-purple-dim: rgba(106, 76, 224, 0.1);
  --brand-purple-glow: rgba(106, 76, 224, 0.3);
  --text-head: #111111;
  --text-body: #333333;
  --text-dim: #555555;
  --border-color: #d1d5db; 
  --code-bg: #e0e0e0;
  --code-border: #999999;
  --input-focus-bg: #ffffff;

  --btn-text: #333333;       
  --btn-border: #bbbbbb;     
  --btn-bg: rgba(0,0,0,0.03);

  background-color: #eef0f4;
  background-image: none; 
}

/* =========================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================= */
* {
  box-sizing: border-box;
}

body, .page-container {
  margin: 0;
  padding: 0;
  background-color: #030208; 
  color: var(--text-body);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.75; 
  transition: background-color 0.5s ease, color 0.5s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
  background-image:
      repeating-linear-gradient(
          45deg,
          transparent,
          transparent 10px,
          rgba(124, 92, 255, 0.05) 10px,
          rgba(124, 92, 255, 0.05) 11px
      ),
      radial-gradient(circle at 50% 0%, rgba(124, 92, 255, 0.25) 0%, transparent 60%);

  background-size: auto, 100% 100%;
  background-attachment: fixed;
}

h1, h2, h3, h4, h5 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-head);
  margin-top: 0;
}

.hero-title {
    font-size: 3rem; 
    line-height: 1.1;
    margin-bottom: 25px; 
    color: #ffffff; 
    text-shadow: 0 0 25px rgba(124, 92, 255, 0.6); 
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

body[data-theme="light"] .hero-title {
    color: var(--brand-purple); 
    text-shadow: 0 0 10px rgba(106, 76, 224, 0.25);
}

h2 {
    font-size: 28px;
    padding-left: 20px;
    border-left: 5px solid var(--brand-purple);
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.1) 0%, transparent 80%);
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 40px; 
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

/* =========================================
   LAYOUT UTILITIES
   ========================================= */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
  min-height: 100vh;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-core);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  padding-bottom: 60px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.view-case-card {
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-purple);
    padding: 20px;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.view-case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--brand-purple-dim);
}

.section-divider {
  border-bottom: 1px solid var(--border-color);
  margin: 50px 0 30px 0; 
  padding-bottom: 10px;
  color: var(--brand-purple);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}
.callout .meta-label, .text-box-outline .meta-label {
    color: var(--brand-purple);
}

.section-header-img {
    width: 100%;
    height: auto; 
    margin-bottom: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel);
}

.top-banner-img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* =========================================
   NAVIGATION (Static Top Bar)
   ========================================= */
#sticky-nav {
  position: relative;
  background-color: var(--bg-core); 
  border-bottom: 1px solid var(--border-color);
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  transition: background-color 0.5s ease;
  margin-left: -40px;
  margin-right: -40px;
  width: calc(100% + 80px); 
  z-index: 9999;
}

#sticky-nav .logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-head);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

#sticky-nav .logo img {
  filter: drop-shadow(0 0 8px var(--brand-purple));
  transition: filter 0.3s ease;
}

#sticky-nav .nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

#sticky-nav .nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}

#sticky-nav .nav-link:hover,
#sticky-nav .nav-link.active {
  color: var(--brand-purple);
}

body[data-theme="light"] #sticky-nav .nav-link:hover {
    color: #593bd9;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 8px 16px;
  border: 2px solid var(--brand-purple);
  background: transparent;
  color: var(--brand-purple);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.theme-button:hover {
  background: var(--brand-purple);
  color: #ffffff;
}

.hero-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

/* =========================================
   FLOATING DOCK & HANDLES
   ========================================= */

/* The main container - Acts as the Anchor */
#floating-dock {
    position: fixed;
    /* Default position */
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Align to bottom so handle stays put */
    
    background: transparent; /* Main container is transparent */
    border: none;
    box-shadow: none;
    z-index: 10000;
    
    /* Allow buttons to pop UP outside the container */
    overflow: visible; 
    width: 50px;
    height: 30px; /* Base height matches handle height */
    
    /* Transition for snapping */
    transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1), top 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

#floating-dock.is-dragging {
    transition: none !important;
}

/* The content area - Absolute positioned ABOVE the handle */
#dock-content {
    position: absolute;
    bottom: 100%; /* Push upwards above handle */
    left: 0;
    width: 100%;
    
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    padding-bottom: 12px; /* Visual gap above handle */
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 5px;

    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: bottom center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy pop */
    pointer-events: auto;
}

/* Collapsed State */
#floating-dock.dock-collapsed #dock-content {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    pointer-events: none;
}

/* Buttons styling */
.dock-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0 !important;
    transition: all 0.2s;
    cursor: pointer;
}

.dock-btn:hover {
    background: var(--brand-purple-dim);
    color: var(--brand-purple);
    border-color: var(--brand-purple);
}

#floating-builder-btn {
    color: var(--brand-purple);
}

/* The Handle Container */
#dock-handle {
    width: 50px; /* Matches container width */
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 15px; /* Pill shape */
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: background 0.2s, transform 0.2s;
}

#dock-handle:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* The Glowing LED Bar */
.handle-bar {
    width: 20px;
    height: 4px;
    background-color: #ffffff; /* Hot center */
    border-radius: 2px;
    opacity: 1;
    /* Purple LED Glow Effect */
    box-shadow: 0 0 6px var(--brand-purple), 0 0 12px var(--brand-purple);
    transition: all 0.3s;
}

#floating-dock:hover .handle-bar {
    background-color: #fff;
    box-shadow: 0 0 8px var(--brand-purple), 0 0 16px var(--brand-purple), 0 0 24px var(--brand-purple);
}

/* Floating Menu Overlay Positioning Update */
#floating-nav-overlay {
    position: fixed; 
    bottom: 270px; /* Initial default, but JS will update */
    right: 30px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border-radius: 8px;
    padding: 15px;
    z-index: 10000;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#floating-nav-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#floating-nav-overlay .nav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-body);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    text-transform: uppercase;
}

#floating-nav-overlay .nav-link:hover {
    background: var(--bg-core);
    color: var(--brand-purple);
}

/* HERO SECTION Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  gap: 40px;
  margin-top: 40px;
  margin-bottom: 60px;
  flex-wrap: wrap;
  background-image: url('assets/hero-dk.png');
  background-size: cover; 
  background-position: center;
  background-repeat: no-repeat;
  padding: 40px; 
  border-radius: 8px; 
}

body[data-theme="light"] header {
    background-image: url('assets/hero-lt.png');
}

.header-left {
  flex: 1;
  min-width: 300px;
}

.header-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo-large {
    width: 100%;
    max-width: 150px; 
    height: auto;
    filter: drop-shadow(0 0 20px var(--brand-purple)); 
    transition: filter 0.3s ease, max-width 0.3s ease;
}

body[data-theme="light"] .hero-logo-large {
    filter: drop-shadow(0 0 20px var(--brand-purple));
    max-width: 150px;
}

/* =========================================
   COMPONENTS
   ========================================= */

button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--btn-bg); 
  border: 1px solid var(--btn-border); 
  color: var(--btn-text);
  padding: 10px 18px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
}

button:hover {
  border-color: var(--brand-purple);
  color: var(--brand-purple);
}

button.btn-primary {
  background: var(--brand-purple);
  color: #ffffff;
  border-color: var(--brand-purple);
  font-weight: 600;
}

button.btn-primary:hover {
  background: #6a4ce0;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Square Button Style */
.btn-square {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px; 
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-text);
    border-radius: 4px;
}
.btn-square:hover {
    border-color: var(--brand-purple);
    color: var(--brand-purple);
    background: var(--bg-panel);
}

.btn-delete:hover {
    border-color: #ff4444;
    color: #ff4444;
}

.btn-save:hover {
    border-color: var(--success-color);
    color: var(--success-color);
}

.btn-icon {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
}

.btn-arrow {
    padding: 6px 10px;
    font-size: 14px;
    margin-right: 0;
    border-radius: 3px;
    border: 1px solid var(--btn-border);
    color: var(--btn-text);
    line-height: 1;
}
.btn-arrow:hover {
    color: var(--brand-purple);
    border-color: var(--brand-purple);
}

.callout {
  background: linear-gradient(90deg, var(--brand-purple-dim) 0%, transparent 100%);
  border-left: 3px solid var(--brand-purple);
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-body);
  margin-bottom: 20px;
}
.callout strong {
  color: var(--text-head);
}

.purple-spacer {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-purple), transparent);
  margin: 50px auto; 
  width: 100%;
  opacity: 0.6;
  position: relative;
}
.purple-spacer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 4px;
  background: var(--brand-purple);
  box-shadow: 0 0 10px var(--brand-purple);
}

.decoration-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-purple), transparent);
  margin: 80px 0; 
  opacity: 0.3;
}

.text-box-outline {
  border: 1px solid var(--brand-purple-glow);
  padding: 25px;
  position: relative;
  background: rgba(124, 92, 255, 0.12); 
  margin-bottom: 30px;
  transition: all 0.3s ease;
}
.text-box-outline:hover {
  background: rgba(124, 92, 255, 0.18);
  border-color: var(--brand-purple);
  box-shadow: 0 0 15px var(--brand-purple-dim);
}
.text-box-outline::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; width: 10px; height: 10px;
  border-top: 1px solid var(--brand-purple); border-left: 1px solid var(--brand-purple);
}
.text-box-outline::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px; width: 10px; height: 10px;
  border-bottom: 1px solid var(--brand-purple); border-right: 1px solid var(--brand-purple);
}

.tag-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.tag span {
  color: var(--text-head);
  font-weight: 600;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
    margin-top: 60px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
}

.footer-left { justify-self: start; }
.footer-center { justify-self: center; display: flex; gap: 15px; align-items: center; }
.footer-right { justify-self: end; }

.social-link { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.social-link:hover { color: var(--brand-purple); }
.social-separator { color: var(--border-color); }

/* =========================================
   RWI BUILDER STYLES
   ========================================= */

.rwi-wrapper {
  background: var(--bg-core);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 700px;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  margin-top: 20px;
  overflow: hidden; 
}

.rwi-wrapper ::-webkit-scrollbar { width: 6px; height: 6px; }
.rwi-wrapper ::-webkit-scrollbar-track { background: transparent; }
.rwi-wrapper ::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.rwi-wrapper ::-webkit-scrollbar-thumb:hover { background: var(--brand-purple); }

.rwi-wrapper header {
  border-bottom: 1px solid var(--border-color);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  flex-shrink: 0; 
  background-image: none;
}

body[data-theme="light"] .rwi-wrapper header {
    background-image: none !important;
    background-color: var(--bg-panel);
}

.version-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: var(--bg-core);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
}

.rwi-wrapper .main-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1; 
  overflow: hidden;
}

.rwi-wrapper .panel {
    overflow-y: auto;
    height: 100%;
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.rwi-wrapper .panel:focus-within {
    box-shadow: inset 0 0 20px var(--brand-purple-dim);
    border-color: var(--brand-purple);
}

.rwi-wrapper .left-panel {
    border-right: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}

.rwi-wrapper .panel-header {
    padding: 10px 15px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rwi-wrapper .panel-title {
    font-size: 12px;
    margin: 0;
    color: var(--text-head);
    font-weight: 600;
}

.component-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.component-item:hover { background: var(--bg-panel); }
.component-item.selected { 
    background: var(--brand-purple-dim); 
    border-left: 3px solid var(--brand-purple);
}

.component-controls {
    display: flex;
    gap: 2px;
    margin-right: 8px;
}

.component-name { flex: 1; color: var(--text-body); margin: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.editor-scroll { padding: 20px; outline: none; }
.form-group { margin-bottom: 15px; }
.form-group label {
    display: block; font-size: 10px; color: var(--text-dim);
    text-transform: uppercase; margin-bottom: 5px; font-family: 'JetBrains Mono';
}
.rwi-wrapper input[type="text"],
.rwi-wrapper textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-head);
    padding: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border-radius: 4px;
}
.rwi-wrapper input[type="text"]:focus,
.rwi-wrapper textarea:focus {
    border-color: var(--brand-purple);
    outline: none;
    background: var(--input-focus-bg);
}

.switch { position: relative; display: inline-block; width: 30px; height: 16px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  transition: .4s; border-radius: 16px; border: 1px solid var(--border-color);
}
.slider:before {
  position: absolute; content: "";
  height: 10px; width: 10px; left: 2px; bottom: 2px;
  background-color: var(--text-dim); transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--brand-purple); border-color: var(--brand-purple); }
input:checked + .slider:before { transform: translateX(14px); background-color: #fff; }

#rwi-toast {
    position: fixed; 
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel); 
    border: 1px solid var(--brand-purple);
    color: var(--text-head); 
    padding: 10px 20px; 
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; 
    font-size: 12px;
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 11000;
    width: auto;
    min-width: 250px;
    max-width: 90%;
    text-align: center;
}
#rwi-toast.show { opacity: 1; }

/* =========================================
   MODAL STYLES
   ========================================= */
.hidden { display: none !important; }
.btn-hidden { display: none !important; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 800px;
    height: 80%;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { margin: 0; color: var(--text-head); }
.modal-header button { border: none; font-size: 16px; padding: 5px; }

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.modal-body textarea {
    width: 100%;
    height: 100%;
    background: var(--bg-core);
    color: var(--text-body);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border: none;
    padding: 20px;
    resize: none;
}
.modal-body textarea:focus { outline: none; }

.modal-text-display {
    width: 100%;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-body);
}
.modal-text-display strong { color: var(--text-head); }
.modal-text-display ul { padding-left: 20px; margin-bottom: 20px; }
.modal-text-display li { margin-bottom: 8px; }

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px; 
}

/* =========================================
   MOBILE RESPONSIVENESS FIXES
   ========================================= */
@media (max-width: 768px) {

    .page-container {
        padding: 20px; 
        padding-top: 100px; 
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    h2 {
        font-size: 24px;
        margin-top: 20px;
        margin-bottom: 30px;
    }

    .grid-2, .grid-4 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .text-box-outline, .view-case-card {
        padding: 20px;
    }

    #sticky-nav {
        height: auto;
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        position: relative; 
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
        z-index: 1000;
    }

    #sticky-nav .nav-links {
        display: flex;
        flex-wrap: wrap !important; 
        justify-content: center;
        width: 100%;
        gap: 15px;
        overflow: visible; 
    }
    
    .nav-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    header {
        flex-direction: column-reverse; 
        text-align: center;
        gap: 20px;
        background-image: none !important;
        background-color: var(--bg-panel); 
    }
    
    .header-left {
        min-width: auto;
        width: 100%;
    }

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

    .hero-actions {
        justify-content: center;
    }

    .rwi-wrapper {
        height: auto; 
        min-height: 800px;
    }

    .rwi-wrapper .main-grid {
        grid-template-columns: 1fr; 
        display: flex;
        flex-direction: column;
    }

    .rwi-wrapper .left-panel {
        width: 100%;
        height: 350px; 
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .rwi-wrapper header {
        flex-direction: column !important; 
        gap: 20px;
        align-items: center;
        text-align: center;
        padding-bottom: 20px;
    }
    
    .rwi-wrapper header .btn-group {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        gap: 10px;
    }
    
    .rwi-wrapper header button {
        padding: 8px 12px;
        font-size: 10px;
        flex: 0 1 auto; 
    }

    footer {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }
    
    .footer-left, .footer-center, .footer-right {
        justify-self: center;
    }
}