body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  color: #2c3e50;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  text-align: center;
}

.container {
  width: 80%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
}

.policy-content {
  width: 100%;
  max-width: 900px;
  text-align: left;
  margin: 0 auto;
  padding: 20px;
}

.policy-content .container {
  max-width: none;
  width: 100%;
}

.error-page {
  max-width: 600px;
  margin: 40px auto;
  padding: 40px 20px;
  text-align: center;
}

.error-page h1 {
  color: #6c63ff;
  margin-bottom: 24px;
}

.error-page p {
  color: #2c3e50;
  margin-bottom: 20px;
  line-height: 1.6;
}

.error-icon {
  font-size: 4em;
  margin-bottom: 20px;
  display: block;
}

.error-card {
  background: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.08);
  margin-bottom: 24px;
}

.error-card ul {
  text-align: left;
  margin: 20px 0;
  padding-left: 24px;
}

.error-card li {
  color: #6c757d;
  margin-bottom: 12px;
  line-height: 1.5;
}

.back-link {
  display: inline-block;
  color: #6c63ff;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.back-link:hover {
  background: rgba(108, 99, 255, 0.08);
}

h1, h2 {
  color: #6c63ff;
  margin: 20px 0;
  text-align: center;
}

.site-icon {
  height: 1.2em;
  width: auto;
  margin-right: 0.3em;
  vertical-align: text-top;
  display: inline-block;
}

.site-logo {
  max-width: 100%;
  height: auto;
  max-height: 80px;
}

.footer {
  margin-top: auto;
  padding: 0 10px 10px 10px;
  width: 90%;
  text-align: center;
  font-size: 0.9em;
  color: #6c757d;
}

.section-divider {
  border: none;
  height: 1px;
  background-color: #444;
  margin: 40px auto;
  width: 80%;
  max-width: 600px;
}

.footer .section-divider {
  margin: 20px auto 15px auto;
}

.hidden {
  display: none;
}

.hero-section {
  margin: 50px 0 40px 0;
  text-align: center;
  padding: 20px;
}

.hero-tagline {
  font-size: 2.4em;
  font-weight: 700;
  color: #502d2c;
  margin: 0 0 20px 0;
  line-height: 1.3;
}

.hero-description {
  font-size: 1.25em;
  color: #6c757d;
  margin: 0 0 40px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.features-section {
  margin: 60px 0 40px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.feature-item {
  text-align: center;
  padding: 30px 24px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.15);
}

.feature-icon {
  font-size: 3em;
  margin-bottom: 18px;
  display: inline-block;
  padding: 16px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(108, 99, 255, 0.05) 100%);
  border-radius: 50%;
}

.feature-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 12px 0;
}

.feature-description {
  font-size: 1em;
  color: #6c757d;
  line-height: 1.6;
  margin: 0;
}

.analysis-form {
  margin: 30px 0;
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px;
}

.analysis-form form {
  display: flex;
  gap: 0;
  align-items: stretch;
  width: 100%;
  max-width: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.content-input {
  padding: 18px 20px;
  border: none;
  background-color: #ffffff;
  color: #2c3e50;
  font-size: 16px;
  flex: 1;
  min-width: 0;
}

.content-input:focus {
  outline: none;
}

.content-input::placeholder {
  color: #adb5bd;
}

.analysis-form button {
  background: linear-gradient(135deg, #6c63ff 0%, #5a52d5 100%);
  color: white;
  border: none;
  padding: 18px 32px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.analysis-form button:hover {
  background: linear-gradient(135deg, #5a52d5 0%, #4a45b5 100%);
  transform: scale(1.02);
}

.analysis-form button:active {
  transform: scale(0.98);
}

.analysis-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.analysis-page h1 {
  margin-bottom: 30px;
}

.status-message {
  background: #ffffff;
  border: 1px solid #e9ecef;
  padding: 24px 28px;
  border-radius: 12px;
  text-align: center;
  margin: 24px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.status-message p {
  margin: 10px 0;
  color: #2c3e50;
  line-height: 1.6;
}

.status-message.loading {
  border-left: 4px solid #6c63ff;
}

.status-message.loading::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e9ecef;
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analysis-results {
  margin-top: 30px;
}

.analysis-results.hidden {
  display: none;
}

.sentiment-analysis-result {
  background: #ffffff;
  border: none;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.08);
}

.sentiment-analysis-result h2 {
  color: #6c63ff;
  margin-bottom: 24px;
  font-size: 1.5em;
}

.sentiment-narrative {
  color: #2c3e50;
  line-height: 1.7;
  margin-bottom: 24px;
  font-size: 1.1em;
}

.sentiment-narrative p {
  margin: 0;
}

.detailed-scores {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.05) 0%, rgba(108, 99, 255, 0.02) 100%);
  border-radius: 12px;
  margin-top: 16px;
  border: 1px solid rgba(108, 99, 255, 0.1);
}

.detailed-scores p {
  color: #2c3e50;
  font-size: 16px;
  margin: 8px 0;
}

.detailed-scores strong {
  color: #6c63ff;
}

.login-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.login-page h1 {
  color: #6c63ff;
  margin-bottom: 20px;
}

.login-page p {
  color: #2c3e50;
  margin-bottom: 20px;
  line-height: 1.6;
}

.login-page ul {
  text-align: left;
  display: inline-block;
  margin: 20px auto;
  padding-left: 20px;
}

.login-page li {
  color: #6c757d;
  margin-bottom: 10px;
  line-height: 1.5;
}

.auth-status {
  background: #ffffff;
  border: 1px solid #dee2e6;
  padding: 20px;
  border-radius: 5px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.auth-status p {
  margin: 10px 0;
  color: #2c3e50;
}

.sign-in-page {
  max-width: 500px;
  margin: 40px auto;
  text-align: center;
}

.sign-in-page h1 {
  margin-bottom: 12px;
}

.sign-in-subtitle {
  color: #6c757d;
  font-size: 1.1em;
  margin-bottom: 32px;
  line-height: 1.5;
}

.sign-in-container {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.08);
}

.sign-in-container p.error {
  color: #dc3545;
  background: #fff5f5;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ffebeb;
  margin-bottom: 20px;
}

.google-login-button {
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: block;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-decoration: none;
  position: relative;
}

.google-login-button::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234285F4' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%2334A853' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%23EA4335' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.google-login-button:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-color: #c6c6c6;
}

.google-login-button:active {
  background: #f1f3f4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.facebook-login-button {
  background: #1877f2;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: block;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-decoration: none;
  position: relative;
}

.facebook-login-button::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.facebook-login-button:hover {
  background: #166fe5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.facebook-login-button:active {
  background: #1469d1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.connect-provider-button {
  background: linear-gradient(135deg, #6c63ff 0%, #5a52d5 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 20px auto;
  display: block;
}

.connect-provider-button:hover {
  background: linear-gradient(135deg, #5a52d5 0%, #4a45b5 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.connect-provider-button:active {
  transform: translateY(0);
}

.connect-provider-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.provider-signin-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.provider-signin-page h1 {
  color: #6c63ff;
  margin-bottom: 10px;
}

.user-profile-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.user-profile-container {
  width: 100%;
  position: relative;
  left: -80px;
}

.monitoring-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.monitoring-table th,
.monitoring-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.monitoring-table th {
  background-color: #007cba;
  color: white;
}

.monitoring-table tr:hover {
  background-color: #f5f5f5;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.metric-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 5px;
  border-left: 4px solid #007cba;
  transition: all 0.3s ease;
  position: relative;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.metric-card.error-card {
  border-left-color: #dc3545;
}

.metric-value {
  font-size: 2em;
  font-weight: bold;
  color: #007cba;
}

.error-card .metric-value {
  color: #dc3545;
}

.metric-label {
  color: #666;
  font-size: 0.9em;
  margin-top: 5px;
}

.error-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5em;
}

.success-rate.good {
  color: #28a745;
  font-weight: bold;
}

.success-rate.warning {
  color: #ffc107;
  font-weight: bold;
}

.success-rate.error {
  color: #dc3545;
  font-weight: bold;
}

.tooltip-text {
  cursor: help;
  text-decoration: underline dotted;
}

#page-container > a {
  text-decoration: none;
  color: inherit;
}

#page-container > a:hover,
#page-container > a:visited,
#page-container > a:active,
#page-container > a:focus {
  text-decoration: none;
  color: inherit;
}

#page-container > a h1 {
  color: #6c63ff;
}

@media (max-width: 768px) {
  .container {
    width: 92%;
    max-width: none;
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 0 8px;
  }

  .footer {
    width: 100%;
    padding: 12px;
  }

  .section-divider {
    margin: 30px auto;
    width: 90%;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .hero-tagline {
    font-size: 1.8em;
  }

  .analysis-form form {
    flex-direction: column;
    border-radius: 12px;
  }

  .analysis-form button {
    padding: 16px 20px;
    font-size: 1em;
    border-radius: 0 0 12px 12px;
  }

  .feature-item {
    padding: 24px 20px;
  }

  .sign-in-container {
    margin: 24px auto;
    padding: 24px;
  }

  .error-card {
    padding: 24px;
  }

  .sentiment-analysis-result {
    padding: 24px;
  }

  .policy-content {
    padding: 16px;
  }
}

/* Processing status styles */
.processing-status {
  background: white;
  padding: 48px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.08);
  text-align: center;
}

.processing-status h2 {
  color: #6c63ff;
  margin-bottom: 20px;
}

.processing-status p {
  color: #2c3e50;
  line-height: 1.6;
  margin-bottom: 24px;
}

.processing-hint {
  color: #6c757d;
  font-size: 0.9em;
  margin-top: 24px;
}

/* Loading spinner */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(108, 99, 255, 0.2);
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 24px auto;
}

/* Analysis failed styles */
.analysis-failed {
  background: white;
  padding: 48px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(220, 53, 69, 0.08);
  text-align: center;
  border-top: 4px solid #dc3545;
}

.analysis-failed h2 {
  color: #dc3545;
  margin-bottom: 20px;
}

.analysis-failed .error-message {
  color: #721c24;
  background: #f8d7da;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.analysis-failed p {
  color: #2c3e50;
  line-height: 1.6;
}

.analysis-failed a {
  color: #6c63ff;
  font-weight: 500;
  text-decoration: none;
}

.analysis-failed a:hover {
  text-decoration: underline;
}

/* Token expired styles */
.analysis-token-expired {
  background: white;
  padding: 48px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(255, 153, 0, 0.08);
  text-align: center;
  border-top: 4px solid #ff9900;
}

.analysis-token-expired h2 {
  color: #e68a00;
  margin-bottom: 20px;
}

.analysis-token-expired p {
  color: #2c3e50;
  line-height: 1.6;
}

.analysis-token-expired ul {
  text-align: left;
  max-width: 500px;
  margin: 16px auto;
  color: #2c3e50;
  line-height: 1.6;
}

.analysis-token-expired li {
  margin-bottom: 8px;
}

.analysis-token-expired .button {
  display: inline-block;
  padding: 12px 24px;
  margin: 16px 0;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.analysis-token-expired .primary-button {
  background: #6c63ff;
  color: white;
}

.analysis-token-expired .primary-button:hover {
  background: #5a52d6;
  transform: translateY(-1px);
}

.analysis-token-expired .error-reference {
  color: #6c757d;
  font-size: 0.9em;
  margin-top: 24px;
}

/* Analysis complete styles */
.analysis-complete {
  animation: fadeIn 0.3s ease-in-out;
}

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