/* File: /home/claude/cloudflare-webapp/src/css/style.css */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* ========================================
   ACCESSIBILITY - Skip Link (IS 5568 / WCAG 2.4.1)
   ======================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* RTL adjustment for skip link */
[dir="rtl"] .skip-link {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

/* ========================================
   ACCESSIBILITY - Screen Reader Only
   ======================================== */
.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;
}

/* ========================================
   ACCESSIBILITY - Focus Visible (Global)
   ======================================== */
:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Remove focus ring for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure buttons and links have visible focus */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar styles removed - using nav.css instead */

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 2rem;
}

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

.hero p {
  font-size: 1.25rem;
  color: #666;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

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

.feature {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

.feature h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

/* Buttons - Base styles only (finance pages use finance-common.css) */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background-color: #f38020;
  color: #fff;
}

.btn-primary:hover {
  background-color: #d97019;
}

.btn-secondary {
  background-color: #fff;
  color: #f38020;
  border: 2px solid #f38020;
}

.btn-secondary:hover {
  background-color: #f38020;
  color: #fff;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #a0aec0;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: #f7fafc;
  color: #4a5568;
}

.btn-retry {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-retry:hover {
  background: #5568d3;
}

/* Auth Pages */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-box {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

/* Form Groups - Base styles (finance pages use finance-common.css) */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

.form-group label .required {
  color: #dc2626;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  border-color: #f38020;
}

/* Focus visible for keyboard users - enhanced accessibility */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: #666;
  font-size: 0.875rem;
}

/* Messages - Consolidated */
.error-message {
  background: #fed7d7;
  border: 1px solid #fc8181;
  color: #742a2a;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.error-message.show,
.error-message.active {
  display: block;
}

.success-message {
  background: #c6f6d5;
  border: 1px solid #9ae6b4;
  color: #22543d;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.success-message.show,
.success-message.active {
  display: block;
}

.info-box {
  background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
  border: none;
  color: #2c5282;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(144, 205, 244, 0.3);
}

.warning-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  color: #856404;
}

/* Loading States */
.loading-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}

.loading-spinner,
.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: #333;
}

.empty-state p {
  margin-bottom: 1.5rem;
  color: #666;
}

/* Error Container */
.error-container {
  text-align: center;
  padding: 3rem;
}

.error-container .error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-container h3 {
  margin-bottom: 0.5rem;
  color: #dc2626;
}

.error-container p {
  margin-bottom: 1.5rem;
  color: #666;
}

.auth-link {
  text-align: center;
  margin-top: 1rem;
  color: #666;
}

.auth-link a {
  color: #f38020;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Dashboard */
.dashboard {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f5f5f5;
}

.dashboard-content {
  display: grid;
  gap: 1.5rem;
}

.dashboard-card {
  background-color: #f9f9f9;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.dashboard-card h3 {
  margin-bottom: 1rem;
  color: #333;
}

#filesList {
  margin-top: 1rem;
}

.file-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #fff;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-item a {
  color: #f38020;
  text-decoration: none;
}

.file-item a:hover {
  text-decoration: underline;
}

#uploadStatus {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
}

#uploadStatus.success {
  background-color: #e8f5e9;
  color: #2e7d32;
}

#uploadStatus.error {
  background-color: #ffebee;
  color: #d32f2f;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
  }
}