/*
 * 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.
 */

/* ============================================
   UNIFIED STYLES FOR THE APPLICATION
   ============================================ */

/* ---- NAVBAR STYLES ---- */
.navbar-brand-app {
  font-family: 'Commissioner', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
}

/* ---- LAYOUT & CONTAINER ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.form-box {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ---- HEADER STYLES ---- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header h1,
.project-header h1,
.secret-header h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
  color: #333;
}

.header-content {
  flex: 1;
}

.project-header,
.secret-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.header-actions {
  display: flex;
  gap: 10px;
  margin-left: 20px;
}

/* ---- SECTION HEADERS ---- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h1,
.section-header h2 {
  margin: 0;
  color: #333;
}

.section-header h1 {
  font-size: 28px;
}

.section-header h2 {
  font-size: 24px;
}

.secrets-section {
  margin-top: 40px;
}

.secret-content-section {
  margin-top: 40px;
}

/* ---- TABLE STYLES ---- */
.projects-table,
.secrets-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.projects-table thead,
.secrets-table thead {
  background-color: #f5f5f5;
}

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

.projects-table tbody tr:hover,
.secrets-table tbody tr:hover {
  background-color: #f9f9f9;
}

.actions {
  width: 200px;
}

/* ---- TEXT UTILITIES ---- */
.text-muted {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.description {
  color: #666;
  font-size: 16px;
  margin: 0 0 15px 0;
  line-height: 1.5;
}

/* ---- CODE STYLES ---- */
code {
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #d73a49;
}

.secret-content-box {
  background-color: #f5f5f5;
  padding: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  overflow-x: auto;
}

.secret-content-box pre {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.secret-content-box code {
  background-color: transparent;
  padding: 0;
  color: #333;
}

.secret-value {
  font-family: monospace;
  color: #666;
}

/* ---- FORM STYLES ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Checkbox with Disclaimer */
.checkbox-with-disclaimer {
  margin-top: 25px;
  margin-bottom: 20px;
}

.checkbox-with-disclaimer input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.checkbox-with-disclaimer label {
  display: inline;
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
}

.disclaimer-text {
  display: block;
  margin-top: 8px;
  margin-left: 24px;
  font-size: 13px;
  color: #6c757d;
  font-style: italic;
}

.disclaimer-text i {
  margin-right: 6px;
  color: #ffc107;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1.5em 1.5em;
  padding-right: 2.5em;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}

/* ---- BUTTON STYLES ---- */
.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-info {
  background-color: #17a2b8;
  color: white;
}

.btn-info:hover {
  background-color: #138496;
}

.btn-warning {
  background-color: #ffc107;
  color: black;
}

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

.btn-danger {
  background-color: #dc3545;
  color: white;
}

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

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ---- BADGE STYLES ---- */
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.badge.active {
  background-color: #28a745;
  color: white;
}

.badge.inactive {
  background-color: #dc3545;
  color: white;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.status-badge.active {
  background-color: #28a745;
}

.status-badge.inactive {
  background-color: #dc3545;
}

.status-badge.archived {
  background-color: #6c757d;
}

/* ---- ALERT STYLES ---- */
.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-danger h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.alert-danger ul {
  margin: 0;
  padding-left: 20px;
}

.alert-danger li {
  margin-bottom: 5px;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-info a {
  color: #0c5460;
  font-weight: bold;
}

/* Danger Zone */
.danger-zone {
  border-top: 2px solid #dc3545;
  padding-top: 30px;
}

.danger-zone .alert-danger {
  border-left: 4px solid #dc3545;
}

.danger-zone h5 {
  color: #dc3545;
  font-weight: bold;
}

/* ---- LOGIN STYLES ---- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
  font-size: 28px;
}

.signup-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 14px;
}

.signup-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.signup-link a:hover {
  text-decoration: underline;
}

/* ---- MEMBER AVATAR STYLES ---- */
.secret-members {
  display: flex;
  gap: 1px;
  flex-wrap: wrap;
}

.member-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

.member-avatar:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
}

.member-avatar.member-count {
  background-color: #999;
}

/* Color palette for avatars */
.member-avatar:nth-child(1) { background-color: #667eea; }
.member-avatar:nth-child(2) { background-color: #764ba2; }
.member-avatar:nth-child(3) { background-color: #f093fb; }
.member-avatar:nth-child(4) { background-color: #4facfe; }
.member-avatar:nth-child(5) { background-color: #00f2fe; }
.member-avatar:nth-child(6) { background-color: #43e97b; }
.member-avatar:nth-child(7) { background-color: #fa709a; }
.member-avatar:nth-child(8) { background-color: #fee140; }
.member-avatar:nth-child(9) { background-color: #30b0fe; }
.member-avatar:nth-child(10n) { background-color: #a8edea; }

/* ---- COPY BUTTON STYLES ---- */
.copy-btn {
  padding: 8px 10px;
  font-size: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.copy-btn:hover {
  background-color: #0056b3;
}

.content-actions {
  display: flex;
  gap: 8px;
}

.content-actions form {
  display: inline;
  margin: 0;
}

/* Inline forms in tables */
td form {
  display: inline;
  margin: 0;
}

/* ---- SECRETS TABLE STYLES ---- */
.secrets-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.secrets-table thead {
  background-color: #f5f5f5;
}

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

.secrets-table tbody tr:hover {
  background-color: #f9f9f9;
}

.secret-content-display {
  font-family: monospace;
  font-size: 12px;
  width: 200px;
  word-wrap: break-word;
  word-break: break-word;
  display: block;
}

.secret-masked,
.secret-revealed {
  display: block;
  padding: 2px 6px;
  background-color: #f5f5f5;
  border-radius: 3px;
  max-width: 100%;
}

.secret-revealed code {
  background-color: transparent;
  padding: 0;
  color: #333;
}

.access-count {
  display: inline-block;
  padding: 2px 8px;
  background-color: #e8f4f8;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #0c5460;
}

.actions-group {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #666;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  border-radius: 4px;
  padding: 4px;
}

.action-icon:hover {
  color: #333;
  transform: scale(1.1);
}

.action-icon i {
  font-size: 16px;
}

.action-view {
  color: #0066cc;
}

.action-view:hover {
  color: #004499;
}

.action-toggle {
  color: #667eea;
}

.action-toggle:hover {
  color: #5568d3;
}

.action-toggle.active {
  color: #5568d3;
}

.action-copy {
  color: #28a745;
}

.action-copy:hover {
  color: #218838;
}

.action-remove {
  color: #dc3545;
  background: none !important;
  border: none !important;
  padding: 4px !important;
  box-shadow: none !important;
  min-width: auto !important;
}

.action-remove:hover {
  color: #c82333;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Role Dropdown Button */
.role-dropdown-btn {
  background: none;
  border: none;
  padding: 0;
  color: #0066cc;
  cursor: pointer;
  font-weight: normal;
  text-decoration: none;
  transition: color 0.2s ease;
}

.role-dropdown-btn:hover {
  color: #004499;
  text-decoration: underline;
}

.role-dropdown-btn::after {
  margin-left: 0.5rem;
}

/* Access Management Sections */
.grant-access-box {
  margin-bottom: 40px;
  border-left: none !important;
}

.current-access-box {
  border-left: none !important;
}

/* ---- SEARCH DROPDOWN STYLES ---- */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  margin-top: -1px;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #f5f5f5;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-name {
  font-weight: 500;
  color: #333;
}

.search-result-email {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.search-no-results {
  padding: 12px;
  text-align: center;
  color: #666;
}

/* ---- LANDING PAGE STYLES ---- */
* {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

.landing-page {
  background: #f8f9fa;
  overflow-x: hidden;
}

/* ---- HERO SECTION ---- */
.hero-section {
  background: white;
  color: #333;
  padding: 80px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 600px;
}

.hero-content {
  z-index: 2;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

.hero-tagline {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-weight: 300;
}

.hero-description {
  font-size: 1rem;
  color: #666;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

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

.btn-primary-large,
.btn-secondary-large {
  display: inline-block;
  padding: 16px 40px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary-large {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-primary-large:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary-large {
  background: transparent;
  color: #667eea;
  border-color: #667eea;
}

.btn-secondary-large:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.hero-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image {
  max-width: 100%;
  height: auto;
}

/* ---- PROBLEM SECTION ---- */
.problem-section {
  padding: 80px 40px;
  background: white;
}

.problem-content {
  max-width: 1200px;
  margin: 0 auto;
}

.problem-section h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 3rem;
  color: #333;
}

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

.problem-card {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.problem-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.problem-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.problem-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #333;
}

.problem-card p {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ---- SOLUTION SECTION ---- */
.solution-section {
  padding: 80px 40px;
  background: white;
  color: #333;
}

.solution-content {
  max-width: 1200px;
  margin: 0 auto;
}

.solution-section h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 3rem;
  color: #333;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.feature {
  text-align: center;
}

.feature-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #333;
}

.feature p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
}

/* ---- FINAL CTA SECTION ---- */
.final-cta {
  padding: 80px 40px;
  background: white;
  text-align: center;
}

.final-cta h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #333;
  margin-bottom: 2rem;
}

/* ---- RESPONSIVE DESIGN ---- */
@media (max-width: 768px) {
  .hero-section {
    grid-template-columns: 1fr;
    padding: 60px 20px;
    min-height: auto;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .problem-section,
  .solution-section,
  .final-cta {
    padding: 60px 20px;
  }

  .problem-section h2,
  .solution-section h2,
  .final-cta h2 {
    font-size: 2rem;
  }

  .problem-grid,
  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 40px 15px;
  }

  .hero-section h1 {
    font-size: 1.5rem;
  }

  .hero-tagline {
    font-size: 0.9rem;
  }

  .btn-primary-large,
  .btn-secondary-large {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn-primary-large,
  .btn-secondary-large {
    width: 100%;
  }

  .problem-section,
  .solution-section,
  .final-cta {
    padding: 40px 15px;
  }

  .problem-section h2,
  .solution-section h2,
  .final-cta h2 {
    font-size: 1.5rem;
  }
}

/* ---- MEMBER ACTIONS ---- */
.member-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
