/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #374151;
  background-color: #f9fafb;
  margin: 0;
  padding: 0;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header h1 {
  color: #111827;
  margin: 0;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

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

.user-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.user-info p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  border: 1px solid #6b7280;
}

.btn-secondary:hover {
  background-color: #4b5563;
  border-color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Dashboard Content */
.dashboard-content {
  display: grid;
  gap: 2rem;
}

/* Stats Section */
.stats h2 {
  color: #111827;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  margin: 0 0 0.75rem 0;
  color: #6b7280;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.025em;
}

/* Recent Alerts */
.recent-alerts {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.recent-alerts h2 {
  color: #111827;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.recent-alerts p {
  color: #6b7280;
  margin: 0;
  font-size: 0.875rem;
}

/* Alert List Styles */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.alert-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  border-left: 4px solid #d1d5db;
  transition: all 0.2s ease;
}

.alert-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.alert-item.alert-critical {
  border-left-color: #dc2626;
  background-color: #fef2f2;
}

.alert-item.alert-high {
  border-left-color: #ea580c;
  background-color: #fff7ed;
}

.alert-item.alert-medium {
  border-left-color: #d97706;
  background-color: #fffbeb;
}

.alert-item.alert-low {
  border-left-color: #059669;
  background-color: #f0fdf4;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.alert-header h4 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 600;
}

.alert-severity {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alert-critical .alert-severity {
  background-color: #dc2626;
  color: white;
}

.alert-high .alert-severity {
  background-color: #ea580c;
  color: white;
}

.alert-medium .alert-severity {
  background-color: #d97706;
  color: white;
}

.alert-low .alert-severity {
  background-color: #059669;
  color: white;
}

.alert-description {
  color: #6b7280;
  margin: 0 0 1rem 0;
  line-height: 1.5;
  font-size: 0.875rem;
}

.alert-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
}

.alert-app {
  font-weight: 500;
  color: #6b7280;
}

.alert-time {
  font-style: italic;
}

/* Devise Forms Styling */
.devise-form {
  max-width: 400px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.devise-form h2 {
  color: #111827;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  color: #374151;
  font-weight: 500;
  font-size: 0.875rem;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="text"]:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.field input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(1.1);
}

.field label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.actions {
  margin-top: 1.5rem;
}

.actions input[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background-color: #374151;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.actions input[type="submit"]:hover {
  background-color: #1f2937;
}

.links {
  margin-top: 1rem;
  text-align: center;
}

.links a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
}

.links a:hover {
  color: #374151;
  text-decoration: underline;
}

/* Flash Messages */
.alert, .notice {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.notice {
  background-color: #f0fdf4;
  color: #059669;
  border: 1px solid #bbf7d0;
}

/* Application Management Styles */
.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-primary {
  background-color: #374151;
  color: white;
  border: 1px solid #374151;
}

.btn-primary:hover {
  background-color: #1f2937;
  border-color: #1f2937;
}

.btn-outline {
  background-color: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-outline:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
  border: 1px solid #f59e0b;
}

.btn-warning:hover {
  background-color: #d97706;
  border-color: #d97706;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
  border: 1px solid #dc2626;
}

.btn-danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Applications Grid */
.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.application-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.application-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.application-header h3 {
  margin: 0;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
}

.application-actions {
  display: flex;
  gap: 0.5rem;
}

.application-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

.api-key, .dsn-url {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  background-color: #f3f4f6;
  padding: 0.5rem;
  border-radius: 4px;
  word-break: break-all;
  border: 1px solid #e5e7eb;
}

.api-key-container, .dsn-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-copy {
  background-color: #6b7280;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-copy:hover {
  background-color: #4b5563;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-top: 2rem;
}

.empty-state h2 {
  color: #111827;
  margin-bottom: 1rem;
}

.empty-state p {
  color: #6b7280;
  margin-bottom: 2rem;
}

/* Form Styles */
.form-container {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.application-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.field-help {
  color: #6b7280;
  font-size: 0.75rem;
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.error-messages {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.error-messages h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.error-messages ul {
  margin: 0;
  padding-left: 1rem;
}

.error-messages li {
  font-size: 0.875rem;
}

/* Info Section */
.info-section {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.info-section h3 {
  color: #111827;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.info-section ul {
  margin: 0;
  padding-left: 1rem;
  color: #4b5563;
}

.info-section li {
  margin-bottom: 0.5rem;
}

/* Application Details Grid */
.application-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.detail-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.detail-section h3 {
  color: #111827;
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

/* Action Section */
.action-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.action-section h3 {
  color: #111827;
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Usage Section */
.usage-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.usage-section h3 {
  color: #111827;
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.code-example {
  background: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

.code-example pre {
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.code-example code {
  color: #f9fafb;
}
