/**
 * Terms of Service Styles for VehicleTrace
 */

/* TOS Modal Overlay */
.tos-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.tos-modal.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Modal Content */
.tos-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Header */
.tos-header {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.tos-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
}

.tos-subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

/* Quick Summary */
.tos-quick-summary {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 1.5rem;
  margin: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.tos-quick-summary h3 {
  margin: 0 0 0.75rem 0;
  color: #166534;
  font-size: 1.1rem;
}

.tos-quick-summary p {
  margin: 0 0 1rem 0;
  color: #374151;
}

.tos-quick-summary ul {
  margin: 0 0 1rem 0;
  padding-left: 1.25rem;
}

.tos-quick-summary li {
  margin-bottom: 0.5rem;
  color: #4b5563;
  line-height: 1.5;
}

.tos-quick-summary li strong {
  color: #166534;
}

.tos-expand-note {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 0 !important;
}

/* Sections Container */
.tos-sections-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 1.5rem;
  margin-bottom: 1rem;
  scroll-behavior: smooth;
}

/* Individual Section */
.tos-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.tos-section-header {
  padding: 1rem;
  cursor: pointer;
  background: #f9fafb;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.tos-section-header:hover {
  background: #f3f4f6;
}

.tos-section-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
  flex: 1;
  min-width: 200px;
}

.tos-section-summary {
  color: #6b7280;
  font-size: 0.875rem;
  flex: 2;
  min-width: 200px;
}

.tos-expand-icon {
  color: #9ca3af;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

/* Section Details (Expandable) */
.tos-section-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  background: white;
}

.tos-section-details.expanded {
  max-height: 500px;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
}

.tos-section-details p {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

/* Acceptance Area */
.tos-acceptance-area {
  background: #f9fafb;
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.tos-scroll-notice {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.tos-checkbox-container {
  margin-bottom: 1rem;
}

.tos-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #374151;
}

.tos-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #10b981;
}

/* Accept Button */
.btn-tos-accept {
  background: #10b981;
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tos-accept:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

.btn-tos-accept:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.tos-version {
  margin: 1rem 0 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 600px) {
  .tos-modal {
    padding: 1rem 0.5rem;
  }
  
  .tos-header {
    padding: 1.5rem 1rem;
  }
  
  .tos-header h1 {
    font-size: 1.4rem;
  }
  
  .tos-quick-summary {
    margin: 1rem;
    padding: 1rem;
  }
  
  .tos-sections-container {
    max-height: 300px;
    padding: 0 1rem;
  }
  
  .tos-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tos-section-title {
    min-width: 100%;
  }
  
  .tos-section-summary {
    min-width: 100%;
    margin-top: 0.25rem;
  }
  
  .tos-expand-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
  }
  
  .tos-section-header {
    position: relative;
  }
  
  .tos-acceptance-area {
    padding: 1rem;
  }
  
  .btn-tos-accept {
    width: 100%;
  }
}

/* Scrollbar styling for sections container */
.tos-sections-container::-webkit-scrollbar {
  width: 8px;
}

.tos-sections-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.tos-sections-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.tos-sections-container::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
