:root {
  /* Enhanced color palette */
  --black: #080808;
  --dark-gray: #111111;
  --light-gray: #222222;
  --accent: #f0f0f0;
  --accent-secondary: #a3a3a3;
  --accent-highlight: #ffffff;
  --accent-subtle: rgba(255, 255, 255, 0.05);
  --accent-hover: rgba(255, 255, 255, 0.15);
  --success-color: rgba(76, 175, 80, 0.9);
  --success-bg: rgba(76, 175, 80, 0.2);
  --success-border: rgba(76, 175, 80, 0.4);
  --danger-color: rgba(220, 53, 69, 0.9);
  --danger-bg: rgba(220, 53, 69, 0.1);
  --danger-border: rgba(220, 53, 69, 0.5);
  
  /* Refined transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  
  /* Enhanced shadows */
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 15px rgba(255, 255, 255, 0.1);
  
  /* Border radius */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-full: 50%;
  
  /* Typography */
  --font-primary: 'Poppins', 'Helvetica Neue', 'Arial', sans-serif;
  --font-satoshi: 'Satoshi', sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --letter-spacing-tight: 0.01em;
  --letter-spacing-normal: 0.05em;
  --letter-spacing-wide: 0.1em;
  --letter-spacing-logo: 0.8rem;

  /* New variables for enhanced visuals */
  --glow-accent: rgba(120, 200, 255, 0.6);
  --glow-subtle: rgba(120, 200, 255, 0.2);
  --glass-bg: rgba(25, 25, 25, 0.7);
  --glass-border: rgba(255, 255, 255, 0.12);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-track: rgba(0, 0, 0, 0.2);
  --highlight-gradient: linear-gradient(135deg, rgba(120, 200, 255, 0.2), rgba(80, 70, 180, 0.1));
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--black);
  color: var(--accent);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  letter-spacing: var(--letter-spacing-tight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 50% 50%, rgba(25, 25, 25, 0.1) 0%, rgba(0, 0, 0, 0) 80%);
}

.hidden {
  display: none !important;
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--black);
  z-index: 1000;
  transition: var(--transition-smooth);
  background-image: 
    radial-gradient(ellipse at 20% 80%, rgba(60, 60, 80, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(80, 60, 60, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
  overflow: hidden;
  padding: 1rem;
  box-sizing: border-box;
}

.splash-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0) 60%);
  pointer-events: none;
}

/* Subtle paper texture overlay */
.splash-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  z-index: 1;
}

.splash-tagline {
  font-size: clamp(0.75rem, 2vw, 1rem);
  font-weight: var(--font-weight-light);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.splash-subtitle {
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  font-weight: var(--font-weight-light);
  color: var(--accent-secondary);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.8s forwards;
}

.splash-author {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--accent-secondary);
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.8s forwards;
}

.author-name {
  font-family: var(--font-satoshi);
  color: var(--accent);
  font-weight: var(--font-weight-medium);
}

/* Styles for the fallback button */
.fallback-btn {
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent-highlight);
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  transition: var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: inline-block;
}

.fallback-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong), 0 0 15px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Fixed keyboard legend styles */
.keyboard-icon {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  animation: pulse 2s infinite ease-in-out;
  z-index: 1500; /* Increased z-index to ensure visibility above splash screen */
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced keyboard shortcuts dialog with modern styling */
.keyboard-legend {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(17, 17, 17, 0.9);
  padding: 1.75rem;
  border-radius: var(--border-radius-lg);
  max-width: 420px;
  width: 90%;
  display: none;
  opacity: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 2100;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}

.modal-body .journal-section:nth-child(2) p {
  font-family: var(--font-satoshi);
}

.keyboard-legend.visible {
  display: block;
  opacity: 1;
  animation: fadeIn 0.3s ease-out forwards;
}

.keyboard-legend h3 {
  font-size: 1.2rem;
  font-weight: var(--font-weight-regular);
  margin-bottom: 1.25rem;
  color: var(--accent-highlight);
  letter-spacing: 0.05em;
  text-align: center;
  position: relative;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.keyboard-legend ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.keyboard-legend li {
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  letter-spacing: var(--letter-spacing-tight);
  display: flex;
  align-items: center;
}

.key {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.75rem;
  font-family: monospace;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  min-width: 1.5rem;
  text-align: center;
}

@media (max-width: 768px) {
  .keyboard-legend {
    width: 95%;
    padding: 1.5rem;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.logo {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: var(--font-weight-light);
  letter-spacing: clamp(0.3rem, 2vw, 0.6rem);
  margin-bottom: clamp(1rem, 3vh, 2rem);
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.4s forwards;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
  position: relative;
  color: var(--accent-highlight);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  text-transform: uppercase;
  text-align: center;
  padding: 0 1rem;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-secondary), transparent);
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeIn 1s ease-out 1s forwards;
}

button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-secondary);
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: var(--font-weight-light);
  letter-spacing: var(--letter-spacing-wide);
  cursor: pointer;
  transition: var(--transition);
  margin: 0.7rem;
  border-radius: var(--border-radius-sm);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--accent);
  opacity: 0.1;
  transition: width 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: -1;
}

button:hover {
  background: transparent;
  color: var(--accent-highlight);
  border-color: var(--accent-highlight);
  box-shadow: var(--shadow-soft), 0 0 10px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

button:hover::after {
  width: 100%;
}

button:active {
  transform: scale(0.98) translateY(0);
  box-shadow: var(--shadow-soft);
  transition: all 0.1s ease-out;
}

.start-btn {
  opacity: 0;
  animation: fadeIn 1s ease-out 1.2s forwards;
  background-color: rgba(255, 255, 255, 0.08);
  border-width: 1px;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.12em;
  box-shadow: var(--shadow-soft);
  padding: 1rem 2rem;
}

.read-more-btn {
  opacity: 0;
  animation: fadeIn 1s ease-out 1.5s forwards;
  border-width: 1px;
  background-color: transparent;
  font-size: 0.85rem;
  padding: 0.75rem 1.8rem;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Splash loader - centered positioning */
.splash-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--accent);
  z-index: 1100;
}

.splash-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.splash-loader .loading-text {
  font-size: 0.9rem;
  color: var(--accent-secondary);
  letter-spacing: 0.05em;
}

/* Gallery loading indicator - centered overlay */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 2000;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.loading-indicator.fade-out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-indicator .loading-text {
  font-size: 0.85rem;
  color: var(--accent-secondary);
  letter-spacing: 0.1em;
  font-family: var(--font-satoshi);
  text-transform: uppercase;
}

/* Gallery footer - minimal signature */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  z-index: 100;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.page-footer:hover {
  opacity: 1;
}

.footer-link {
  color: var(--accent-secondary);
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  font-family: var(--font-satoshi);
}

.footer-link:hover {
  color: var(--accent);
}

/* Mobile navigation buttons */
@media (max-width: 768px) {
  .nav-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    opacity: 0.7 !important;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
  }
  
  .splash-content {
    padding: 0 1rem;
  }
  
  .splash-subtitle {
    font-size: 0.85rem;
    max-width: 280px;
  }
  
  .splash-author {
    bottom: 1.5rem;
  }
  
  .start-btn {
    padding: 0.85rem 1.8rem;
    font-size: 0.9rem;
  }
  
  .read-more-btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.8rem;
  }
}

/* Small screen optimizations */
@media (max-width: 480px) {
  .logo {
    font-size: 1.6rem;
    letter-spacing: 0.2rem;
  }
  
  .splash-tagline {
    font-size: 0.65rem;
  }
  
  .splash-subtitle {
    font-size: 0.75rem;
    max-width: 240px;
  }
  
  .gallery-item {
    padding: 1rem;
  }
  
  .gallery-item img {
    max-height: 85vh;
  }
}

/* Gallery */
.gallery-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--black);
  background-image: linear-gradient(to bottom, rgba(20, 20, 20, 0.8) 0%, rgba(8, 8, 8, 1) 100%);
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

.gallery-track {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.gallery-item {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 2rem;
  transition: opacity 0.5s ease-out;
}

.gallery-item img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  filter: grayscale(10%) contrast(1.02);
  transition: var(--transition-smooth);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 1px rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  transform-origin: center center;
  opacity: 0.97;
  will-change: transform, filter, opacity;
  border: none;
  position: relative;
  z-index: 1;
}

.gallery-item img:hover {
  filter: grayscale(0%) contrast(1.05);
  transform: scale(1.01);
  opacity: 1;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 0 2px rgba(255, 255, 255, 0.15);
}

.gallery-nav {
  position: absolute;
  left: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(-50%);
  z-index: 10;
}

.nav-btn {
  position: fixed;
  background: var(--accent-subtle);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--border-radius-full);
  backdrop-filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  opacity: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  box-shadow: var(--shadow-soft);
  will-change: transform, opacity, background-color;
}

.nav-btn.prev {
  top: 2rem;
}

.nav-btn.next {
  bottom: 2rem;
}

.nav-btn:hover {
  background: var(--accent-hover);
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
  box-shadow: var(--shadow-strong), 0 0 15px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-btn:active {
  transform: translateX(-50%) scale(0.95);
  transition: all 0.1s ease-out;
}

.nav-btn.prev::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.nav-btn.next::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.nav-btn:hover::before {
  opacity: 1;
}

.gallery-container:hover .nav-btn {
  opacity: 0.8;
  animation: fadeIn 0.3s ease-out forwards;
}

.gallery-container .nav-btn.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  from { opacity: 0.8; }
  to { opacity: 0; }
}

@media (max-width: 768px) {
  .nav-btn {
    bottom: 1rem;
    width: 2.2rem;
    height: 2.2rem;
  }
  
  .gallery-track {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  .splash-screen {
    padding: 1.5rem; /* Increase padding on smaller screens */
  }
  
  .logo {
    letter-spacing: calc(var(--letter-spacing-logo) * 0.7); /* Reduce letter spacing on small screens */
  }
  
  .start-btn, .read-more-btn {
    padding: 0.8rem 2rem; /* Slightly smaller buttons on mobile */
    margin: 0.5rem;
  }
  
  .keyboard-icon {
    bottom: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
  }
  
  .fallback-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
}

/* Orientation styles */
.orientation-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* Use viewport height */
  background-color: var(--black);
  color: var(--accent);
  z-index: 300;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  box-sizing: border-box; /* Ensure padding doesn't affect overall size */
}

.orientation-message img {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  animation: rotate 2s infinite ease-in-out;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

@media screen and (orientation: portrait) and (max-width: 768px) {
  .orientation-message {
    display: flex;
  }
  
  .splash-screen,
  .gallery-container,
  .modal {
    display: none !important;
  }
}

/* Image Container and Metadata */
.image-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-metadata {
  display: none; /* Hide the metadata text that appears to the right of images */
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Completely redesigned Read More Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(8px);
}

.modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: min(95%, 680px);
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(15, 15, 15, 0.95));
  border-radius: 16px;
  overflow: hidden;
  margin: 2rem auto;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(30px);
  opacity: 0;
  animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Header section with visual treatment */
.modal-header {
  position: relative;
  padding: 3rem 2.5rem 1.5rem;
  background: linear-gradient(to bottom, rgba(40, 40, 40, 0.8), transparent);
  text-align: center;
}

.modal-header h2 {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 300;
  margin: 0 0 1rem;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-divider {
  height: 3px;
  width: 80px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
  margin: 0 auto 1.5rem;
}

/* Content section with scrolling */
.modal-body {
  padding: 0 2.5rem 2.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Custom scrollbar */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Visual Journal section */
.journal-section {
  margin-bottom: 2.5rem;
}

.journal-section h3 {
  font-size: 1.4rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
}

.journal-section h3:before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #3a8bd6, #5b6bd8);
  margin-right: 12px;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(59, 139, 214, 0.5);
}

.journal-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  font-weight: 300;
}

/* Theory collection grid */
.theory-collection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

/* Theory card styling */
.theory-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.theory-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-left-color: #5b6bd8;
}

.theory-item strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: #fff;
}

.theory-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* Design callout section */
.design-callout {
  background: rgba(91, 107, 216, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.design-callout:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(91, 107, 216, 0.2) 0%, transparent 100%);
  opacity: 0.1;
}

.design-callout h4 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: #6b7ceb;
}

.design-callout p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* Philosophy quote styling */
.philosophy-text {
  position: relative;
  font-style: italic;
  padding: 2rem 1.5rem;
  margin: 2.5rem 0 2rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.philosophy-text:before,
.philosophy-text:after {
  content: '"';
  position: absolute;
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.1);
  line-height: 1;
}

.philosophy-text:before {
  top: 10px;
  left: 10px;
}

.philosophy-text:after {
  bottom: -20px;
  right: 10px;
}

/* E-business card link */
.business-card-link {
  display: block;
  text-align: center;
  margin: 2rem 0 1rem;
  padding: 1rem;
}

.modal-link {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, #3a8bd6, #5b6bd8);
  border-radius: 30px;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 139, 214, 0.3);
}

.modal-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 139, 214, 0.4);
}

/* Close button styling */
.close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.close-modal:before,
.close-modal:after {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease;
}

.close-modal:before {
  transform: rotate(45deg);
}

.close-modal:after {
  transform: rotate(-45deg);
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
  .modal-header {
    padding: 2.5rem 1.5rem 1rem;
  }
  
  .modal-body {
    padding: 0 1.5rem 1.5rem;
  }
  
  .theory-collection {
    grid-template-columns: 1fr;
  }
}

/* Settings Button */
.settings-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 150;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--border-radius-full);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft), 0 0 10px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
  font-size: 1.2rem;
  cursor: pointer;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(30deg);
  box-shadow: var(--shadow-strong), 0 0 15px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.settings-btn.active {
  background: rgba(76, 175, 80, 0.4);
  border-color: rgba(76, 175, 80, 0.7);
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
  transform: rotate(30deg);
}

/* Builder Mode Indicator */
.builder-indicator {
  position: fixed;
  top: 1rem;
  left: 4.5rem;
  background-color: rgba(76, 175, 80, 0.4);
  color: rgba(255, 255, 255, 1);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 150;
  border: 1px solid rgba(76, 175, 80, 0.7);
  box-shadow: var(--shadow-soft), 0 0 10px rgba(76, 175, 80, 0.4);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s ease-out;
  pointer-events: none;
}

.builder-indicator.active {
  opacity: 1;
  transform: translateX(0);
}

/* Overlay Button */
.overlay-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 150;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius-sm);
  font-weight: 400;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}

.overlay-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong), 0 0 15px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Custom Dialog */
.custom-dialog {
  position: absolute;
  background-color: var(--dark-gray);
  padding: 1.25rem;
  border-radius: var(--border-radius-md);
  z-index: 10000; /* Highest z-index for dialogs */
  box-shadow: var(--shadow-strong), 0 0 20px rgba(0, 0, 0, 0.5); /* Enhanced shadow */
  animation: dialogFadeIn 0.3s ease-out forwards;
  transform-origin: top left;
  border: 1px solid rgba(255, 255, 255, 0.2); /* More visible border */
  min-width: 280px;
}

.custom-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--border-radius-full);
  background: rgba(255, 255, 255, 0.3); /* Increased visibility */
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4); /* Added border for better visibility */
  box-shadow: var(--shadow-soft), 0 0 15px rgba(255, 255, 255, 0.4); /* Enhanced glow */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  animation: pulseLight 2s infinite ease-in-out;
  z-index: 155; /* Increased z-index to ensure visibility */
  position: absolute;
}

.custom-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
  box-shadow: var(--shadow-strong), 0 0 20px rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
}

.custom-btn:active {
  transform: scale(0.95);
}

@keyframes pulseLight {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.custom-dialog h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--accent-highlight);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.custom-dialog .dialog-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
}

.custom-dialog .save-btn,
.custom-dialog .delete-btn {
  padding: 0.6rem 1.2rem;
  margin-right: 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  margin: 0;
}

.custom-dialog .save-btn {
  background-color: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
  color: rgba(255, 255, 255, 0.9);
}

.custom-dialog .save-btn:hover {
  background-color: rgba(76, 175, 80, 0.3);
  border-color: rgba(76, 175, 80, 0.7);
}

.custom-dialog .delete-btn {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.5);
  color: rgba(220, 53, 69, 0.9);
}

.custom-dialog .delete-btn:hover {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.8);
  color: rgba(220, 53, 69, 1);
}

@keyframes dialogFadeIn {
  from { 
    opacity: 0;
    transform: scale(0.95);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

.custom-dialog textarea {
  width: 100%;
  min-width: 250px;
  min-height: 120px;
  background-color: var(--light-gray);
  color: var(--accent);
  border: 1px solid var(--accent-secondary);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: var(--transition);
}

.custom-dialog textarea:focus {
  outline: none;
  border-color: var(--accent-highlight);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Saved Indicator */
.saved-indicator {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: rgba(76, 175, 80, 0.3);
  color: rgba(255, 255, 255, 1);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  z-index: 170;
  border: 1px solid rgba(76, 175, 80, 0.6);
  box-shadow: var(--shadow-soft), 0 0 10px rgba(76, 175, 80, 0.4);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: all 0.3s ease-out;
}

.saved-indicator.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Blur-up placeholder for lazy images */
.blur-up {
  filter: blur(12px) saturate(0.6);
  transform: scale(1.02);
  transition: filter 450ms ease, transform 450ms ease, opacity 350ms ease;
}

.loaded {
  filter: none !important;
  transform: none !important;
  opacity: 1 !important;
}

/* Lightbox styles */
.image-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.image-lightbox.visible { opacity: 1; }
.image-lightbox.hidden { display: none; }

.image-lightbox .lightbox-inner {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  width: min(1200px, 95%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-strong);
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.06);
  color: var(--accent);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }

.lightbox-caption {
  color: var(--accent-secondary);
  font-size: 0.95rem;
  text-align: center;
  max-width: 90%;
}