/* public/styles/base.css */

/* CSS Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text);
}

/* Container and Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
header {
  background-color: var(--surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

nav a:hover {
  color: var(--primary);
}

nav a.contrast {
  background: var(--primary-dark);
  color: var(--background);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

nav a.contrast:hover {
  background: var(--accent-dark);
  color: var(--background);
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #000000 !important;
  background: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem 0;
  color: var(--text);
  font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin: 0 0 1rem 0;
}

/* Buttons */
button, .button, input[type="submit"] {
  background: var(--primary-dark);
  color: var(--background);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

button:hover, .button:hover, input[type="submit"]:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Forms */
input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.3);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Main content */
main {
  min-height: 80vh;
  padding: 2rem 0;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

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

.projects.grid {
  margin-top: 3rem;
}

/* Portfolio-specific styling */
.hero {
  text-align: center;
  padding: 4rem 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .container {
    padding: 0 0.5rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

:root {
  /* Accessible Color Palette */
  --background: #121212; /* deep charcoal background */
  --surface: #1e1e1e; /* card & form bg - dark grey */
  --surface-light: #2a2a2a; /* lighter surface for contrast */
  --text: #f5f5f5; /* high contrast white text */
  --text-muted: #b3b3b3; /* muted text with good contrast */
  --primary: #7dd3fc; /* accessible pastel blue */
  --primary-dark: #0ea5e9; /* darker blue for buttons */
  --accent: #a7f3d0; /* accessible pastel green accent */
  --accent-dark: #10b981; /* darker green for interactions */
  --warning: #fde68a; /* accessible pastel yellow */
  --error: #fca5a5; /* accessible pastel red */

  /* Shared design tokens */
  --radius: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
  --transition: all 0.2s ease-in-out;
}

.hero {
  background: linear-gradient(135deg, var(--primary), var(--accent)), 
              url('/images/hero-bg.jpg') center/cover no-repeat;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  padding: 6rem 0;
}
.hero .container {
  max-width: 700px;
  text-align: center;
}
.hero .contrast {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
}

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

.card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover,
.card:focus-within {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

footer {
  padding: 2rem 0;
  font-size: 0.9rem;
  background: var(--surface);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.brand-block {
  flex: 1;
  min-width: 250px;
}

.brand-block strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.brand-block p {
  margin: 0.5rem 0;
  opacity: 0.8;
}

.brand-block a {
  display: inline-block;
  margin: 1rem 0 0.5rem 0;
  color: var(--contrast);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.brand-block a:hover {
  transform: translateX(4px);
}

.brand-block small {
  display: block;
  opacity: 0.6;
  margin-top: 1rem;
}

/* Social links styling */
nav[aria-label="Social links"] {
  flex-shrink: 0;
}

.social {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  transition: var(--transition);
}

.social a:hover {
  background: var(--contrast);
  transform: translateY(-2px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  footer .container {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .brand-block {
    min-width: auto;
  }
  
  .social {
    justify-content: center;
  }
}


button,
a.contrast {
  transition: var(--transition);
}

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

button:hover,
button:focus,
a.contrast:hover,
a.contrast:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.error-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  min-height: 60vh;
  padding: 2rem 0;
}

.error-content {
  text-align: left;
}

.error-icon {
  color: var(--contrast);
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.error-title {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.error-message {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.error-code {
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  display: inline-block;
  margin-bottom: 2rem;
  font-family: 'Courier New', monospace;
  border: 1px solid rgba(0,0,0,0.1);
}

.error-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.error-btn-primary,
.error-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.error-btn-primary {
  background: var(--contrast);
  color: white;
}

.error-btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.error-btn-primary:hover,
.error-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.error-details {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.1);
}

.error-details summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--primary);
}

.tech-info {
  margin-top: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.tech-info p {
  margin: 0.5rem 0;
}

/* Portfolio variant - Terminal illustration */
.terminal {
  background: var(--background);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-header {
  background: var(--surface);
  padding: 0.5rem 1rem;
  display: flex;
  gap: 0.5rem;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff6b6b; }
.terminal-dot.yellow { background: var(--warning); }
.terminal-dot.green { background: var(--accent); }

.terminal-body {
  padding: 1rem;
  font-family: 'Courier New', monospace;
  color: var(--accent);
}

.terminal-line {
  margin: 0.5rem 0;
}

.prompt {
  color: var(--primary);
}

.error-line {
  color: #ff8a8a;
}

.cursor {
  animation: blink 1s infinite;
}

/* Business variant - Tools illustration */
.tools-error {
  text-align: center;
  position: relative;
}

.tool-icon {
  font-size: 8rem;
  color: var(--primary);
  opacity: 0.3;
}

.sparks {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--contrast);
  border-radius: 50%;
  animation: sparkle 1.5s infinite;
}

.spark:nth-child(1) {
  top: -20px;
  left: -15px;
  animation-delay: 0s;
}

.spark:nth-child(2) {
  top: -10px;
  right: -20px;
  animation-delay: 0.5s;
}

.spark:nth-child(3) {
  bottom: -15px;
  left: -10px;
  animation-delay: 1s;
}

/* Help section */
.error-help {
  margin-top: 4rem;
  text-align: center;
}

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

.help-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
}

.help-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.help-card i {
  font-size: 2rem;
  color: var(--contrast);
  margin-bottom: 1rem;
}

.help-card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

/* Error page animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes sparkle {
  0%, 100% { 
    opacity: 0;
    transform: scale(0);
  }
  50% { 
    opacity: 1;
    transform: scale(1);
  }
}

/* Error page mobile responsiveness */
@media (max-width: 768px) {
  .error-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .error-title {
    font-size: 2rem;
  }
  
  .error-actions {
    justify-content: center;
  }
  
  .help-cards {
    grid-template-columns: 1fr;
  }
  
  .tool-icon {
    font-size: 6rem;
  }
}