
/* Base Styles */
html {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

/* Custom Cursor */
body {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23374151" d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') 12 12, auto;
}

.dark body {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23f3f4f6" d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') 12 12, auto;
}

a, button {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23dc2626" d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') 12 12, pointer;
}

.dark a, .dark button {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23ef4444" d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') 12 12, pointer;
}

body {
  background: linear-gradient(45deg, #f8f6f0 25%, transparent 25%), 
              linear-gradient(-45deg, #f8f6f0 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f8f6f0 75%), 
              linear-gradient(-45deg, transparent 75%, #f8f6f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  transition: all 0.3s ease;
}

body:where(.dark) {
  background: linear-gradient(45deg, #1f2937 25%, transparent 25%), 
              linear-gradient(-45deg, #1f2937 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #1f2937 75%), 
              linear-gradient(-45deg, transparent 75%, #1f2937 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Paper Texture Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(0,0,0,0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.1) 1px, transparent 1px),
    radial-gradient(circle at 40% 60%, rgba(0,0,0,0.1) 1px, transparent 1px);
  background-size: 50px 50px, 30px 30px, 70px 70px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.3;
}

/* Typography */
.drop-cap::first-letter {
  font-size: 4rem;
  font-weight: 900;
  float: left;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
  line-height: 1;
  font-family: 'Playfair Display', serif;
}

@media (max-width: 768px) {
  .drop-cap::first-letter {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .drop-cap::first-letter {
    font-size: 2.5rem;
    float: none;
    display: inline-block;
    margin-top: 0;
  }
}

/* Typewriter Animation */
.typewriter-text {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: currentColor; }
}

/* Newspaper Sections */
.newspaper-column {
  column-gap: 2rem;
  border: 2px solid #374151;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
}

.dark .newspaper-column {
  background: rgba(31, 41, 55, 0.9);
  border-color: #d1d5db;
}

.newspaper-section {
  border: 1px solid #6b7280;
  padding: 2rem;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.8);
  position: relative;
}

.dark .newspaper-section {
  background: rgba(31, 41, 55, 0.8);
  border-color: #9ca3af;
}

.newspaper-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: #374151;
}

.dark .newspaper-section::before {
  background: #d1d5db;
}

/* Info Box */
.newspaper-info-box {
  border: 2px solid #374151;
  padding: 1rem;
  background: #f9fafb;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.dark .newspaper-info-box {
  background: #374151;
  border-color: #d1d5db;
}

/* Quote Box */
.quote-box {
  border-left: 4px solid #374151;
  padding: 1rem;
  background: #f3f4f6;
  font-style: italic;
  margin: 1rem 0;
}

.dark .quote-box {
  background: #4b5563;
  border-color: #d1d5db;
}

/* Project Articles */
.project-article {
  border: 1px solid #d1d5db;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  position: relative;
}

.dark .project-article {
  background: rgba(55, 65, 81, 0.9);
  border-color: #6b7280;
}

.project-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid #374151;
  color: #374151;
  transition: all 0.3s ease;
  text-decoration: none;
}

.dark .project-link {
  border-color: #d1d5db;
  color: #d1d5db;
}

.project-link:hover {
  background: #374151;
  color: white;
  border-radius: 0.5rem;
  transform: scale(1.1);
}

.dark .project-link:hover {
  background: #d1d5db;
  color: #1f2937;
}

/* Classified Ad */
.classified-ad {
  border: 3px double #374151;
  padding: 2rem;
  background: #f9fafb;
  text-align: center;
}

.dark .classified-ad {
  background: #374151;
  border-color: #d1d5db;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  text-decoration: none;
  transition: all 0.3s ease;
  font-family: 'Courier Prime', monospace;
}

.dark .contact-item {
  background: #4b5563;
  border-color: #6b7280;
  color: #f3f4f6;
}

.contact-item:hover {
  background: #374151;
  color: white;
  border-radius: 0.5rem;
  transform: translateY(-2px);
}

.dark .contact-item:hover {
  background: #d1d5db;
  color: #1f2937;
}

/* Navigation Links */
.newspaper-link {
  position: relative;
  transition: all 0.3s ease;
}

.newspaper-link:hover {
  color: #dc2626;
}

.newspaper-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 50%;
  background-color: #dc2626;
  transition: all 0.3s ease;
}

.newspaper-link:hover::after {
  width: 100%;
  left: 0;
}

/* Newspaper Image */
.newspaper-image img,
.newspaper-image div {
  filter: grayscale(100%);
  border: 2px solid #374151;
}

.dark .newspaper-image div {
  border-color: #d1d5db;
}

/* Chatbot */
.chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  border: none;
}

.chatbot-button:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 300px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dark .chatbot-window {
  background: #374151;
  border-color: #6b7280;
}

/* Theme Toggle */
#theme-toggle {
  transition: all 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
}

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  .fixed {
    display: none !important;
  }
  
  .newspaper-section,
  .newspaper-column,
  .project-article {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .typewriter-text {
    animation: none;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .newspaper-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .newspaper-column {
    padding: 1.25rem;
    column-gap: 1.5rem;
  }
  
  .contact-links {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .typewriter-text {
    white-space: normal;
    animation: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .newspaper-column {
    padding: 1rem;
    column-gap: 1rem;
  }
  
  .newspaper-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .drop-cap::first-letter {
    font-size: 3rem;
    margin-right: 0.25rem;
  }
  
  .contact-links {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .contact-item {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  .chatbot-window {
    width: calc(100vw - 2rem);
    max-width: 300px;
    right: 0;
    left: 1rem;
  }
  
  .project-article {
    padding: 1rem;
  }
  
  .classified-ad {
    padding: 1.5rem;
  }
  
  .quote-box {
    padding: 0.75rem;
    margin: 0.75rem 0;
  }
  
  .newspaper-info-box {
    padding: 0.75rem;
  }
}

@media (max-width: 640px) {
  .newspaper-section {
    padding: 0.75rem;
  }
  
  .newspaper-column {
    padding: 0.75rem;
  }
  
  .drop-cap::first-letter {
    font-size: 2.5rem;
    float: none;
    display: inline-block;
    margin-right: 0.25rem;
    margin-top: 0;
  }
  
  .project-article {
    padding: 0.75rem;
  }
  
  .classified-ad {
    padding: 1rem;
  }
  
  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
  }
  
  .chatbot-window {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    left: 0.5rem;
    bottom: 80px;
  }
  
  .chatbot-button {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .newspaper-section {
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .newspaper-column {
    padding: 0.5rem;
  }
  
  .project-article {
    padding: 0.5rem;
  }
  
  .classified-ad {
    padding: 0.75rem;
  }
  
  .quote-box {
    padding: 0.5rem;
  }
  
  .newspaper-info-box {
    padding: 0.5rem;
  }
  
  .contact-item i {
    font-size: 1.25rem;
  }
}

/* Trail Canvas */
#trail-canvas {
  width: 100vw;
  height: 100vh;
}

/* Scroll Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.rotate-in {
  opacity: 0;
  transform: rotate(-5deg) scale(0.9);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.rotate-in.visible {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Stagger animation delays */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }
.fade-in:nth-child(5) { transition-delay: 0.5s; }
.fade-in:nth-child(6) { transition-delay: 0.6s; }

/* Message Form Styles */
.message-form {
  border: 3px double #374151;
  padding: 2rem;
  background: #f9fafb;
  position: relative;
}

.dark .message-form {
  background: #374151;
  border-color: #d1d5db;
}

.message-form::before {
  content: '✉️';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #f9fafb;
  padding: 0 10px;
  font-size: 1.5rem;
}

.dark .message-form::before {
  background: #374151;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: #374151;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark .form-label {
  color: #f3f4f6;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #374151;
  background: #ffffff;
  color: #374151;
  font-family: 'Courier Prime', monospace;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.dark .form-input {
  background: #4b5563;
  border-color: #6b7280;
  color: #f3f4f6;
}

.form-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  transform: translateY(-1px);
}

.dark .form-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

.dark .form-input::placeholder {
  color: #6b7280;
}

.send-button {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(45deg, #dc2626, #991b1b);
  color: white;
  border: 3px solid #7f1d1d;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.send-button:hover {
  background: linear-gradient(45deg, #991b1b, #7f1d1d);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(220, 38, 38, 0.3);
}

.send-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

.send-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.send-button:hover::before {
  left: 100%;
}

#form-status {
  border: 2px solid;
  padding: 0.75rem;
  font-weight: bold;
}

#form-status.success {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

.dark #form-status.success {
  background: #14532d;
  border-color: #22c55e;
  color: #4ade80;
}

#form-status.error {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
}

.dark #form-status.error {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #f87171;
}

/* Responsive Form Styles */
@media (max-width: 1024px) {
  .message-form {
    padding: 1.5rem;
  }
  
  .form-input {
    padding: 0.625rem;
    font-size: 0.9rem;
  }
  
  .send-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .message-form {
    padding: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
  }
  
  .form-input {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  .send-button {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .message-form {
    padding: 0.75rem;
  }
  
  .form-input {
    padding: 0.5rem;
  }
  
  .send-button {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Dark mode transitions */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
