/* Tester Mode Specific Styles */

body.tester-mode {
  overflow: auto;
}

/* Notification Toast */
.notification-toast {
  position:        fixed;
  top:             -100px;
  left:            50%;
  transform:       translateX(-50%);
  background:      var(--success-color);
  color:           white;
  padding:         16px 32px;
  border-radius:   8px;
  box-shadow:      0 4px 12px rgba(0, 0, 0, 0.3);
  font-weight:     600;
  z-index:         2000;
  transition:      top 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity:         0;
}

.notification-toast.show {
  top:     20px;
  opacity: 1;
}

.notification-toast.fade-out {
  opacity: 0;
}

#tester-app {
  width:      100%;
  min-height: 100vh;
}

/* View Management */
.tester-view {
  display: none;
}

.tester-view.active {
  display: block;
}

/* Landing Page */
.landing-container {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  min-height:      100vh;
  padding:         40px 20px;
  background:      linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.landing-header {
  text-align:    center;
  color:         white;
  margin-bottom: 40px;
}

.landing-header h1 {
  font-size:     3em;
  margin-bottom: 20px;
  text-shadow:   2px 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-text {
  font-size:   1.3em;
  opacity:     0.95;
  max-width:   600px;
  line-height: 1.6;
}

.landing-form {
  background:    white;
  padding:       40px;
  border-radius: 12px;
  box-shadow:    0 10px 40px rgba(0, 0, 0, 0.3);
  max-width:     500px;
  width:         100%;
}

.landing-form .form-group {
  margin-bottom: 24px;
}

.landing-form label {
  display:       block;
  font-weight:   600;
  margin-bottom: 8px;
  font-size:     1.1em;
}

.landing-form input {
  width:         100%;
  padding:       12px;
  font-size:     1.1em;
  border:        2px solid var(--border-color);
  border-radius: 6px;
  transition:    border-color 0.2s;
}

.landing-form input:focus {
  outline:      none;
  border-color: var(--primary-color);
}

.landing-form small {
  display:    block;
  margin-top: 6px;
  color:      var(--text-muted);
  font-size:  0.9em;
}

.btn-large {
  width:         100%;
  padding:       16px;
  font-size:     1.3em;
  font-weight:   600;
  margin-top:    10px;
  border-radius: 8px;
}

.landing-footer {
  margin-top: 30px;
  text-align: center;
}

.admin-link {
  display:         inline-flex;
  align-items:     center;
  gap:             8px;
  padding:         12px 24px;
  color:           var(--text-muted);
  text-decoration: none;
  border:          2px solid var(--border-color);
  border-radius:   8px;
  transition:      all 0.2s;
  background:      var(--surface-color);
}

.admin-link:hover {
  color:        var(--primary-color);
  border-color: var(--primary-color);
  transform:    translateY(-2px);
  box-shadow:   0 4px 12px rgba(0, 0, 0, 0.1);
}

.cat-face {
  font-size: 1.5em;
}

.admin-text {
  font-weight: 500;
}

/* Tester Header */
.tester-header {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         20px 30px;
  background:      var(--surface-color);
  border-bottom:   1px solid var(--border-color);
  position:        sticky;
  top:             0;
  z-index:         100;
}

.header-left {
  display:     flex;
  align-items: center;
  gap:         16px;
}

.header-left h2 {
  margin: 0;
}

.tester-name {
  color:       var(--text-muted);
  font-size:   0.95em;
  padding:     4px 12px;
  background:  var(--bg-color);
  border-radius: 4px;
}

.header-right {
  display: flex;
  gap:     12px;
}

.btn-text {
  background:   none;
  border:       none;
  color:        var(--primary-color);
  cursor:       pointer;
  padding:      8px 12px;
  font-size:    0.95em;
  text-decoration: underline;
}

.btn-text:hover {
  color: var(--primary-color);
  opacity: 0.8;
}

/* Testing Container */
.testing-container {
  max-width: 1400px;
  margin:    0 auto;
  padding:   30px;
}

.testing-controls {
  background:    var(--surface-color);
  padding:       24px;
  border-radius: 8px;
  margin-bottom: 24px;
  border:        1px solid var(--border-color);
}

.select-with-create {
  display: flex;
  gap:     8px;
}

.select-with-create select {
  flex: 1;
}

.testing-stats {
  display:    flex;
  gap:        20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  font-size: 0.95em;
}

.stat-item strong {
  font-size:   1.2em;
  margin-left: 4px;
}

.stat-pass strong   { color: var(--success-color); }
.stat-fail strong   { color: var(--danger-color); }
.stat-untested strong { color: var(--warning-color); }
.stat-none strong   { color: var(--text-muted); }

/* Ad-hoc Bug Button */
.adhoc-bug-section {
  margin-top: 24px;
  text-align: center;
}

.btn-warning {
  background-color: var(--warning-color);
  color:            white;
  border:           none;
}

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

/* Test Execution View */
.test-execution-container {
  max-width: 1400px;
  margin:    0 auto;
  padding:   30px;
}

.execution-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   30px;
  margin-bottom:         30px;
}

.test-info-column input[readonly],
.test-info-column textarea[readonly] {
  background-color: var(--bg-color);
  font-weight:      500;
  cursor:           default;
}

.test-info-column input[readonly] {
  font-size:   1.1em;
  font-weight: 600;
}

.bug-form-card {
  background:    var(--bg-color);
  padding:       20px;
  border-radius: 6px;
  border:        1px solid var(--border-color);
  margin-top:    12px;
}

.bug-search-dropdown {
  position:   absolute;
  top:        100%;
  left:       0;
  right:      0;
  background: white;
  border:     1px solid var(--border-color);
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  z-index:    1000;
  display:    none;
}

.bug-search-dropdown.show {
  display: block;
}

.bug-search-item {
  padding:    10px;
  cursor:     pointer;
  border-bottom: 1px solid var(--border-color);
}

.bug-search-item:hover {
  background: var(--bg-color);
}

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

/* Test Actions */
.test-actions {
  display:         flex;
  gap:             16px;
  justify-content: center;
  padding-top:     24px;
  border-top:      2px solid var(--border-color);
}

.btn-action {
  min-width:  140px;
  font-size:  1.15em;
  padding:    14px 28px;
  font-weight: 600;
}

.btn-success {
  background-color: var(--success-color);
  color:            white;
  border:           none;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-danger {
  background-color: var(--danger-color);
  color:            white;
  border:           none;
}

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

/* Modal Styles */
.modal {
  display:         none;
  position:        fixed;
  z-index:         1000;
  left:            0;
  top:             0;
  width:           100%;
  height:          100%;
  background:      rgba(0, 0, 0, 0.5);
  align-items:     center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background:    var(--surface-color);
  border-radius: 8px;
  max-width:     600px;
  width:         90%;
  max-height:    90vh;
  overflow-y:    auto;
  box-shadow:    0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
  max-width: 900px;
}

.modal-header {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         20px 24px;
  border-bottom:   1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
}

.btn-close {
  background:  none;
  border:      none;
  font-size:   1.8em;
  color:       var(--text-muted);
  cursor:      pointer;
  line-height: 1;
  padding:     0;
  width:       30px;
  height:      30px;
}

.btn-close:hover {
  color: var(--text-color);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display:         flex;
  justify-content: flex-end;
  gap:             12px;
  padding:         16px 24px;
  border-top:      1px solid var(--border-color);
}

/* Checkbox List (used for story chooser) */
.checkbox-list {
  max-height: 200px;
  overflow-y: auto;
  border:     1px solid var(--border-color);
  padding:    8px;
  border-radius: 4px;
  background: var(--bg-color);
}

/* Story Select Items */
.story-select-item {
  padding:       10px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  cursor:        pointer;
  transition:    all 0.2s;
  border:        2px solid transparent;
}

.story-select-item:hover {
  background: var(--surface-color);
  border-color: var(--border-color);
}

.story-select-item.selected {
  background:   #e0f2fe;
  border-color: var(--primary-color);
}

.story-select-id {
  font-weight:   600;
  color:         var(--text-color);
  margin-bottom: 4px;
  font-size:     0.95em;
}

.story-select-desc {
  font-size: 0.9em;
  color:     var(--text-muted);
  line-height: 1.4;
}

/* Bug List */
#bug-list {
  margin-bottom: 12px;
}

.bug-item {
  background:    var(--bg-color);
  padding:       12px;
  margin-bottom: 8px;
  border-radius: 4px;
  border:        1px solid var(--border-color);
  display:       flex;
  justify-content: space-between;
  align-items:   start;
}

.bug-item-text {
  flex: 1;
}

.bug-item-title {
  font-weight:   600;
  margin-bottom: 4px;
}

.bug-item-repro {
  font-size: 0.9em;
  color:     var(--text-muted);
}

.bug-item-remove {
  background:  var(--danger-color);
  color:       white;
  border:      none;
  padding:     4px 8px;
  border-radius: 4px;
  cursor:      pointer;
  font-size:   0.85em;
}

.bug-item-remove:hover {
  background: #b91c1c;
}

/* Bug Detail Modal */
.bug-detail-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   30px;
}

.bug-info-section h4,
.bug-actions-section h4 {
  margin-top:    0;
  margin-bottom: 16px;
  font-size:     1.1em;
  color:         var(--text-color);
}

.related-items {
  background:    var(--bg-color);
  border:        1px solid var(--border-color);
  border-radius: 4px;
  padding:       12px;
  min-height:    60px;
  max-height:    150px;
  overflow-y:    auto;
}

.related-item {
  padding:       8px;
  margin-bottom: 6px;
  background:    white;
  border-radius: 3px;
  font-size:     0.9em;
}

.related-item:last-child {
  margin-bottom: 0;
}

.related-item-title {
  font-weight: 600;
  color:       var(--text-color);
}

.related-item-detail {
  color:       var(--text-muted);
  font-size:   0.95em;
  margin-top:  4px;
}

/* Comments List */
.comments-list {
  max-height:    300px;
  overflow-y:    auto;
  margin-bottom: 16px;
  border:        1px solid var(--border-color);
  border-radius: 4px;
  padding:       12px;
  background:    var(--bg-color);
}

.comment-item {
  background:    white;
  padding:       12px;
  margin-bottom: 12px;
  border-radius: 4px;
  border-left:   3px solid var(--primary-color);
}

.comment-item:last-child {
  margin-bottom: 0;
}

.comment-header {
  display:         flex;
  justify-content: space-between;
  margin-bottom:   8px;
  font-size:       0.85em;
}

.comment-author {
  font-weight: 600;
  color:       var(--primary-color);
}

.comment-date {
  color: var(--text-muted);
}

.comment-text {
  color:       var(--text-color);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comments-empty {
  color:      var(--text-muted);
  font-style: italic;
  text-align: center;
  padding:    20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .execution-grid {
    grid-template-columns: 1fr;
  }

  .test-actions {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
  }

  .landing-header h1 {
    font-size: 2em;
  }

  .welcome-text {
    font-size: 1.1em;
  }
}
