/* SCA Brand Kit CSS Variables */
:root {
  /* Primary Colors */
  --sca-navy: #002d4b;
  
  /* Secondary Colors */
  --sca-light-blue: #5ac8f5;
  --sca-purple: #c878f1;
  --sca-orange: #ffa959;
  --sca-teal: #036370;
  
  /* Gradient */
  --sca-gradient: linear-gradient(to bottom, #5ac8f5, #0078ff);
  
  /* Typography */
  --sca-font-family: 'Proxima Nova', 'Jost', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 45, 75, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 45, 75, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 45, 75, 0.2);
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: var(--sca-font-family);
  font-weight: 300;
  line-height: 1.6;
  color: var(--sca-navy);
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  min-height: 100vh;
}

/* Container and Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: white;
  box-shadow: var(--shadow-lg);
}

/* Header Styles */
.sca-header {
  background: var(--sca-navy);
  color: white;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sca-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--sca-gradient);
  opacity: 0.1;
  z-index: 0;
}

.sca-logo {
  max-height: 60px;
  width: auto;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.sca-heading {
  font-family: var(--sca-font-family);
  font-weight: 800;
  font-size: 2rem;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* User Info Styles */
.user-info {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.user-info span {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Authentication Section */
.auth-section {
  text-align: center;
  padding: 3rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-content {
  max-width: 400px;
  margin: 0 auto;
}

.auth-content h2 {
  margin-bottom: 1rem;
  color: var(--sca-navy);
}

.auth-content p {
  margin-bottom: 2rem;
  color: #6c757d;
  line-height: 1.6;
}

/* Hide elements by default */
.hidden {
  display: none !important;
}

.sca-subheading {
  font-family: var(--sca-font-family);
  font-weight: 600;
  color: var(--sca-navy);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--sca-light-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.spinner-small {
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--sca-light-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Contract Details */
.contract-details {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9ecef;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-item label {
  font-weight: 600;
  color: var(--sca-navy);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item span {
  font-weight: 400;
  color: var(--sca-navy);
  font-size: 1rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--sca-light-blue);
}

/* File Upload Section */
.file-upload-area {
  border: 2px dashed var(--sca-light-blue);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--sca-navy);
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
}

.file-upload-area.drag-over {
  border-color: var(--sca-orange);
  background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
  transform: scale(1.02);
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sca-navy);
  margin-bottom: 0.25rem;
}

.upload-text.error-text {
  color: #d32f2f;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.upload-subtext {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 0.75rem;
}

/* Selected File Display */
.selected-file {
  background: var(--sca-gradient);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  color: white;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-icon {
  font-size: 1.5rem;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 600;
  margin: 0;
}

.file-size {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

.remove-file-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.remove-file-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Button Styles */
.sca-btn-primary {
  background: var(--sca-light-blue);
  color: white;
  font-family: var(--sca-font-family);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.sca-btn-primary:hover {
  background: var(--sca-teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.sca-btn-gradient {
  background: var(--sca-gradient);
  color: white;
  font-family: var(--sca-font-family);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 32px;
  cursor: pointer;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 300px;
}

.sca-btn-gradient:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.sca-btn-gradient:active:not(:disabled) {
  transform: translateY(0);
}

.sca-btn-gradient:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #6c757d;
}

/* Submit Section */
.submit-section {
  text-align: center;
  padding: 0;
}

.submit-section .sca-btn-gradient {
  width: 100%;
  max-width: none;
  padding: 12px 24px;
  font-size: 1rem;
}

/* Success and Error Messages */
.success-message, .error-message {
  text-align: center;
  padding: 3rem;
}

.success-message {
  color: #155724;
}

.error-message {
  color: #721c24;
}

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

.error-message h2 {
  color: #721c24;
  margin-bottom: 1rem;
}

.error-message p {
  margin-bottom: 2rem;
}

/* Footer */
.sca-footer {
  background: var(--sca-navy);
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 0;
    min-height: 100vh;
  }
  
  .sca-header {
    padding: 1.5rem 1rem;
  }
  
  .sca-heading {
    font-size: 1.5rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .contract-details {
    padding: 1.5rem;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .file-upload-area {
    padding: 2rem 1rem;
  }
  
  .upload-text {
    font-size: 1rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
button:focus,
input:focus {
  outline: 2px solid var(--sca-orange);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --sca-navy: #000000;
    --sca-light-blue: #0066cc;
  }
}

/* Dashboard View Styles */
.dashboard-view {
  width: 100%;
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: calc(100vh - 250px);
  min-height: 600px;
}

.contracts-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border-bottom: 2px solid var(--sca-light-blue);
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.dashboard-header .sca-subheading {
  margin-bottom: 0;
  white-space: nowrap;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: flex-end;
}

.search-input {
  padding: 10px 16px;
  border: 2px solid var(--sca-light-blue);
  border-radius: var(--radius-sm);
  font-family: var(--sca-font-family);
  font-size: 0.9rem;
  color: var(--sca-navy);
  background: white;
  transition: all 0.3s ease;
  min-width: 250px;
  max-width: 350px;
}

.search-input:focus {
  outline: none;
  border-color: var(--sca-navy);
  box-shadow: 0 0 0 3px rgba(90, 200, 245, 0.2);
}

.search-input::placeholder {
  color: #6c757d;
  opacity: 0.7;
}

.upload-all-btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  white-space: nowrap;
  max-width: 150px;
}

.contracts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

/* Contract Card Styles */
.contract-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}

.contract-card:hover {
  border-color: var(--sca-light-blue);
  box-shadow: var(--shadow-md);
}

.contract-info-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contract-card-header {
  margin-bottom: 0.75rem;
  position: relative;
}

.contract-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sca-navy);
  margin: 0 0 0.25rem 0;
}

.contract-card-subtitle {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 400;
  margin: 0;
}

.contract-card-body {
  margin-top: 1rem;
}

.contract-card-field {
  margin-bottom: 0.75rem;
}

.contract-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sca-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.25rem;
}

.contract-card-value {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--sca-navy);
  display: block;
}

.contract-card-value.large {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Contract Upload Section Styles */
.contract-upload-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
  border-radius: var(--radius-md);
  border: 1px solid #e9ecef;
}

.upload-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sca-navy);
  margin: 0;
  text-align: center;
}

/* Upload Status Messages */
.upload-status-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
  min-height: 200px;
}

.upload-status-message p {
  margin: 0.5rem 0;
  color: var(--sca-navy);
}

.upload-status-message .status-subtext {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.upload-status-message.success {
  background: linear-gradient(135deg, #e6ffe6 0%, #f0fff0 100%);
  border-radius: var(--radius-md);
}

.upload-status-message.error {
  background: linear-gradient(135deg, #ffe6e6 0%, #fff0f0 100%);
  border-radius: var(--radius-md);
}

.success-icon-small {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.error-icon-small {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.reset-upload-btn {
  margin-top: 1rem;
}

.upload-instructions {
  color: #6c757d;
  font-size: 0.875rem;
  margin: -0.5rem 0 0.5rem 0;
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
  .contract-card {
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .dashboard-container {
    height: auto;
  }

  .contract-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contract-upload-section {
    margin-top: 0;
  }

  .search-input {
    min-width: 200px;
    max-width: 250px;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    gap: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .search-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    min-width: 100%;
    max-width: 100%;
  }

  .upload-all-btn {
    max-width: 100%;
    width: 100%;
  }

  .contract-card {
    padding: 1rem;
  }

  .contract-card-value.large {
    font-size: 1rem;
  }

  .file-upload-area {
    padding: 1rem;
  }

  .upload-text {
    font-size: 0.8rem;
  }

  .upload-subtext {
    font-size: 0.7rem;
  }
}
