/* Component-specific styles for Impact Projects */

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

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--neutral-gray-300);
  border-top: 2px solid var(--accent-violet);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Score Card Animations */
.score-card {
  position: relative;
  overflow: hidden;
}

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

.score-card:hover::before {
  left: 100%;
}

/* Chart Tooltip */
.chart-tooltip {
  position: absolute;
  background: var(--neutral-gray-900);
  color: white;
  padding: var(--spacing-2) var(--spacing-3);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.chart-tooltip.show {
  opacity: 1;
}

.chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--neutral-gray-900);
}

/* Project Navigation Enhancements */
.project-navigation {
  position: relative;
}

.nav-arrow {
  position: relative;
  overflow: hidden;
}

.nav-arrow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

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

.nav-arrow svg {
  position: relative;
  z-index: 1;
  transition: color var(--transition-normal);
}

.nav-arrow:hover svg {
  color: white;
}

/* Tag Animations */
.tag {
  position: relative;
  overflow: hidden;
}

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

.tag:hover::before {
  left: 100%;
}

/* Success Story Card Enhancements */
.story-card {
  position: relative;
}

.story-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: var(--border-radius);
  z-index: -1;
}

.story-card:hover::after {
  opacity: 0.02;
}

/* AI Status Pulse Animation */
.status-indicator.online {
  position: relative;
}

.status-indicator.online::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: var(--secondary-emerald);
  border-radius: var(--border-radius-sm);
  transform: translate(-50%, -50%);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
}

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary-gradient);
  z-index: 1000;
  transition: width 0.1s ease;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: var(--spacing-6);
  right: var(--spacing-6);
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body {
  padding: 24px;
}

.modal-body p {
  margin: 0 0 24px 0;
  color: #6b7280;
  line-height: 1.6;
}

/* Form Styles */
.subscription-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.form-group input,
.form-group select {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
  color: #9ca3af;
}

.checkbox-group {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: #4f46e5;
}

.submit-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  padding: 12px 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 32px 24px;
}

.success-message h3 {
  color: #059669;
  margin-bottom: 12px;
}

.success-message p {
  color: #6b7280;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header,
  .modal-body {
    padding: 20px;
  }
  
  .modal-header h2 {
    font-size: 1.25rem;
  }
}

/* Notification Styles */
.notification {
  position: fixed;
  top: var(--spacing-6);
  right: var(--spacing-6);
  padding: var(--spacing-4) var(--spacing-6);
  border-radius: var(--border-radius);
  color: white;
  font-weight: 500;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: var(--secondary-emerald);
}

.notification.error {
  background: #EF4444;
}

.notification.warning {
  background: var(--secondary-amber);
}

.notification.info {
  background: var(--secondary-cyan);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--neutral-gray-200) 25%, var(--neutral-gray-100) 50%, var(--neutral-gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--spacing-2);
  border-radius: var(--border-radius-sm);
}

.skeleton-title {
  height: 2em;
  margin-bottom: var(--spacing-4);
  border-radius: var(--border-radius-sm);
}

.skeleton-card {
  height: 200px;
  border-radius: var(--border-radius);
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .nav-arrow,
  .cta-button,
  .back-to-top {
    display: none !important;
  }
  
  .main-content {
    padding: 0;
  }
  
  .project-title {
    -webkit-text-fill-color: black !important;
    color: black !important;
  }
  
  .score-card {
    break-inside: avoid;
  }
}

/* Image Placeholder Styles */
.image-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
}

.placeholder-content {
    text-align: center;
    color: #64748b;
}

.placeholder-content svg {
    margin-bottom: 16px;
}

.placeholder-content p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Story Image Styles */
.story-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.story-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.story-image:hover img {
    transform: scale(1.02);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .story-image img,
    .image-placeholder {
        height: 200px;
    }
    
    .placeholder-content svg {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }
    
    .placeholder-content p {
        font-size: 0.8rem;
    }
} 