/* =================================
   SHARED STYLES - Nodisa Labs
   Used across all tools
   ================================= */

/* CSS Reset & Base Styles */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #3F4C5C;
  background-color: #F6F8F9;
  padding: 20px;
  max-width: 8.5in;
  margin: 0 auto;
}

/* Header & Navigation */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 3px solid #2D7D7D;
  margin-bottom: 20px;
  top: 0;
  background: #fff;
  z-index: 100;
}

header .brand { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}

header img { 
  height: 50px; 
}

header h1 { 
  margin: 0; 
  font-size: 1.5rem; 
  color: #2D7D7D; 
}

nav { 
  display: flex; 
  gap: 20px; 
}

nav a {
  text-decoration: none;
  color: #3F4C5C;
  font-weight: 500;
  transition: color 0.3s;
  padding: 8px 12px;
  border-radius: 4px;
}

nav a:hover { 
  color: #FF6B47;
  background-color: rgba(255, 107, 71, 0.1);
}

nav a.active {
  font-weight: 700;
  color: #FF6B47;
  border-bottom: 2px solid #FF6B47;
  padding-bottom: 6px;
  background-color: rgba(255, 107, 71, 0.05);
}

/* Common Buttons */
.btn { 
  padding: 10px 14px; 
  border: 0; 
  border-radius: 8px; 
  background: #2D7D7D; 
  color: #fff; 
  cursor: pointer; 
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  background: #1E5A5A;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(45, 125, 125, 0.2);
}

.btn.secondary { 
  background: #f3f4f6; 
  color: #3F4C5C; 
  border: 1px solid #d1d5db; 
}

.btn.secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
  transform: none;
  box-shadow: none;
}

.btn:focus {
  outline: 3px solid rgba(45, 125, 125, 0.3);
  outline-offset: 2px;
}

/* Loading spinner for buttons */
.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #E5F4F4;
  text-align: center;
  color: #6B7280;
  font-size: 12px;
}

.footer a {
  color: #2D7D7D;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  text-decoration: underline;
  color: #FF6B47;
}

/* Common Help Text */
.help-text { 
  font-size: 12px; 
  color: #6B7280; 
  font-style: italic; 
  margin-top: 4px; 
  line-height: 1.4;
}

/* Common Alert/Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.notification-info { 
  background: #2D7D7D; 
}

.notification-success { 
  background: #10B981; 
}

.notification-error { 
  background: #EF4444; 
}

.notification-warning { 
  background: #F59E0B; 
}

@keyframes slideIn {
  from { 
    transform: translateX(100%); 
    opacity: 0; 
  }
  to { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

/* Draft Banner Styles */
.draft-banner {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.1);
}

.draft-content {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.draft-content span {
  flex: 1;
  min-width: 200px;
  font-weight: 500;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(-10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Common Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #2D7D7D;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Focus Indicators for Accessibility */
*:focus {
  outline: 3px solid rgba(45, 125, 125, 0.3);
  outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2D7D7D;
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 4px;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}

/* Screen Reader Only Content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Common Link Styles */
a {
  color: #2D7D7D;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #FF6B47;
}

a:focus {
  outline: 2px solid #FF6B47;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  body { 
    padding: 10px; 
    font-size: 12px; 
    background: white;
    color: black;
  }
  
  header, 
  .notification, 
  .draft-banner,
  .btn { 
    display: none; 
  }
  
  .footer { 
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #000;
    font-size: 10px;
  }
  
  /* Ensure content doesn't break across pages */
  .section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 10px;
  }
  
  nav {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  nav a {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  header img {
    height: 40px;
  }
  
  .notification {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .draft-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .draft-content span {
    min-width: auto;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  nav a:hover,
  nav a.active {
    background-color: #FF6B47;
    color: white;
  }
  
  .btn:focus {
    outline: 3px solid #FF6B47;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn:hover {
    transform: none;
  }
}