/*
 * Application Styles for Test Management System
 * Typography: Montserrat Light for text, Bold Arial for headings
 * Color: #1c0b5a throughout
 * Line-height: 1.3 for text, 1.0 for headings
 */

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

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  line-height: 1.3;
  color: #1c0b5a;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: Arial, sans-serif;
  font-weight: bold;
  line-height: 1.0;
  color: #1c0b5a;
  margin: 1rem 0 1rem 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

label {
  font-weight: 600;
}

/* Layout */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-title {
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 1.5rem;
  color: #1c0b5a;
  line-height: 1.0;
}

/* Header brand link styling - preserve original layout */
.header-brand .brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0.75rem;
}

.header-brand .brand-link:hover {
  text-decoration: none;
  color: inherit;
}

.header-brand .brand-link:visited {
  color: inherit;
}

.header-nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: #1c0b5a;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 300;
}

.nav-link:hover,
.nav-link.active {
  background: #e9ecef;
  color: #1c0b5a;
  text-decoration: none;
}

/* Main Content */
.app-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.user-menu-trigger:hover {
  background-color: rgba(28, 11, 90, 0.05);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c0b5a;
  flex-shrink: 0;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

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

.user-name-inline {
  font-weight: 500;
  color: #1c0b5a;
  font-size: 0.875rem;
}

.chevron-down {
  color: #1c0b5a;
  transition: transform 0.2s ease;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 240px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.user-info .user-name {
  font-weight: 600;
  color: #1c0b5a;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.user-info .user-email {
  color: #1c0b5a;
  font-size: 0.75rem;
  margin-bottom: 0.125rem;
  opacity: 0.7;
}

.user-info .user-org {
  color: #1c0b5a;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  color: #1c0b5a;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.dropdown-link:hover {
  background-color: #f9fafb;
  color: #1c0b5a;
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn-primary {
  background: #1c0b5a;
  color: white;
  border-color: #1c0b5a;
}

.btn-primary:hover {
  background: #150949;
  border-color: #150949;
  color: white;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: #1c0b5a;
  border-color: #1c0b5a;
}

.btn-outline:hover {
  background: #1c0b5a;
  color: white;
  text-decoration: none;
}

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

.btn-danger:hover {
  background: #c82333;
  border-color: #bd2130;
  color: white;
  text-decoration: none;
}

.btn-success {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.btn-success:hover {
  background: #218838;
  border-color: #1e7e34;
  color: white;
  text-decoration: none;
}

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

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.table th {
  background: #f8f9fa;
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #1c0b5a;
  font-size: 0.875rem;
}

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

.table .actions {
  white-space: nowrap;
}

.table .actions .btn {
  margin-right: 0.5rem;
}

/* Cards and Overview */
.overview-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.overview-card h3 {
  margin: 0 0 1rem 0;
  color: #1c0b5a;
}

/* Header Sections */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-section h1 {
  margin: 0;
  color: #1c0b5a;
}

/* Tabs */
.tabs-container {
  margin-top: 2rem;
}

.tabs-nav {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.5rem;
}

.tab-button {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  color: #1c0b5a;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
}

.tab-button:hover {
  color: #1c0b5a;
  background-color: #f9fafb;
  text-decoration: none;
}

.tab-button.active {
  color: #1c0b5a;
  border-bottom-color: #1c0b5a;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

.tab-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: bold;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
}

.status-badge.enabled,
.status-badge.active {
  background: #d1edff;
  color: #0969da;
}

.status-badge.disabled,
.status-badge.inactive {
  background: #f1f3f4;
  color: #656d76;
}

.status-badge.archived {
  background: #f0f0f0;
  color: #666;
}

.status-badge.manual {
  background: #e3f2fd;
  color: #1976d2;
}

.status-badge.tag {
  background: #f3e5f5;
  color: #7b1fa2;
}

.status-badge.pull_request {
  background: #e8f5e8;
  color: #388e3c;
}

.status-badge.branch_push {
  background: #fff3e0;
  color: #f57c00;
}

.status-badge.pending {
  background: #f0f0f0;
  color: #666;
}

.status-badge.running {
  background: #fff3cd;
  color: #856404;
}

.status-badge.completed {
  background: #d1edff;
  color: #0969da;
}

.status-badge.failed {
  background: #ffebe9;
  color: #cf222e;
}

.status-badge.cancelled {
  background: #f1f3f4;
  color: #656d76;
}

/* Forms */
.form-page {
  max-width: 600px;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 2rem;
}

.form-header h1 {
  margin: 0.5rem 0 0 0;
  color: #1c0b5a;
}

.form-container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #1c0b5a;
}

.form-label.required::after {
  content: " *";
  color: #dc3545;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: 'Montserrat', sans-serif;
  color: #1c0b5a;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #1c0b5a;
  box-shadow: 0 0 0 2px rgba(28, 11, 90, 0.25);
}

.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #1c0b5a;
  opacity: 0.7;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label-inline {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  margin-top: 1rem;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-success {
  background: #d1edff;
  color: #0969da;
  border: 1px solid #0969da;
}

.alert-error {
  background: #ffebe9;
  color: #cf222e;
  border: 1px solid #cf222e;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #1c0b5a;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state p {
  margin-bottom: 1rem;
  opacity: 0.7;
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 0.875rem;
  color: #1c0b5a;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.breadcrumb a {
  color: #1c0b5a;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Links and External Elements */
.external-link::after {
  content: " ↗";
  font-size: 0.75rem;
  color: #1c0b5a;
  opacity: 0.7;
}

.project-link,
.scenario-link {
  color: #1c0b5a;
  text-decoration: none;
  font-weight: 500;
}

.project-link:hover,
.scenario-link:hover {
  text-decoration: underline;
}

.file-path {
  background: #f8f9fa;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.75rem;
  color: #1c0b5a;
}

/* Explanation Box */
.explanation-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-left: 4px solid #1c0b5a;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.explanation-box p {
  margin: 0 0 0.5rem 0;
  color: #1c0b5a;
  font-size: 0.875rem;
  line-height: 1.3;
}

.explanation-box p:last-child {
  margin-bottom: 0;
}

.explanation-box ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
}

.explanation-box li {
  margin-bottom: 0.25rem;
  color: #1c0b5a;
  font-size: 0.875rem;
  opacity: 0.8;
}

.explanation-box strong {
  color: #1c0b5a;
  font-weight: 600;
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  color: #1c0b5a;
  font-family: Arial, sans-serif;
  line-height: 1.0;
}

.metric-label {
  font-size: 0.875rem;
  color: #1c0b5a;
  margin-top: 0.25rem;
  opacity: 0.7;
}

/* Utility Classes */
.text-muted {
  color: #1c0b5a !important;
  opacity: 0.6;
}

.text-center {
  text-align: center !important;
}

.text-success {
  color: #28a745 !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-warning {
  color: #ffc107 !important;
}

/* Footer */
.app-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 1rem 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
  color: #1c0b5a;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .header-section {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .table {
    font-size: 0.75rem;
  }
  
  .header-brand {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .brand-title {
    font-size: 1.25rem;
  }
}
