* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #667eea;
  --primary-dark: #5568d3;
  --bg-gradient-start: #667eea;
  --bg-gradient-end: #764ba2;
  --text-dark: #2d3748;
  --text-light: #718096;
  --success-color: #48bb78;
  --error-color: #f56565;
  --warning-color: #ed8936;
  --card-bg: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  color: var(--text-dark);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  animation: backgroundPulse 15s ease-in-out infinite;
  z-index: 0;
}
#details {
  white-space: pre-line;
}
.detail-text {
  white-space: pre-line; /* يخلي \n يشتغل زي <br> */
  line-height: 1.6;
  font-size: 15px;
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  min-height: 100vh;
}

.main-view, .detail-view {
  transition: var(--transition);
}

.hidden {
  display: none;
  opacity: 0;
}

.header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
  animation: slideDown 0.6s ease-out;
}

.header-icon {
  background: var(--card-bg);
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  color: var(--primary-color);
  transition: var(--transition);
  animation: iconFloat 3s ease-in-out infinite;
}

.header-icon:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-text h1 {
  color: white;
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 400;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

.stat-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
  opacity: 1;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stat-total { color: var(--primary-color); }
.stat-passed { color: var(--success-color); }
.stat-failed { color: var(--error-color); }
.stat-rate { color: var(--warning-color); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.stat-value {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  animation: countUp 1s ease-out;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.controls {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.search-box {
  flex: 1;
  min-width: 300px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-box:focus-within {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

.search-box svg {
  color: var(--text-light);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 16px;
  width: 100%;
  background: transparent;
  color: var(--text-dark);
}

.search-box input::placeholder {
  color: var(--text-light);
}

.filter-buttons {
  display: flex;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.filter-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-light);
  transition: var(--transition);
  position: relative;
}

.filter-btn:hover {
  color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
}

.filter-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.categories-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition);
  animation: slideInLeft 0.5s ease-out both;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.category-header {
  padding: 28px 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  position: relative;
}

.category-header:hover {
  background: rgba(102, 126, 234, 0.05);
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  transition: var(--transition);
}

.category-card:hover .category-icon {
  transform: scale(1.1) rotate(5deg);
}

.category-info {
  flex: 1;
}

.category-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.category-description {
  color: var(--text-light);
  font-size: 14px;
}

.category-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}

.category-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}

.bugs-badge {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.expand-icon {
  color: var(--text-light);
  transition: var(--transition);
  margin-left: auto;
}

.category-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.test-cases {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(to bottom, rgba(102, 126, 234, 0.02), transparent);
}

.category-card.expanded .test-cases {
  max-height: 3000px;
}

.test-case {
  padding: 20px 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  animation: fadeInSlide 0.4s ease-out both;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.test-case:hover {
  background: rgba(102, 126, 234, 0.08);
  padding-left: 40px;
}

.test-status {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.test-case:hover .test-status {
  transform: scale(1.2) rotate(10deg);
}

.test-status.passed {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
  animation: successGlow 2s ease-in-out infinite;
}

@keyframes successGlow {
  0%, 100% { box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4); }
  50% { box-shadow: 0 4px 20px rgba(72, 187, 120, 0.6); }
}

.test-status.failed {
  background: linear-gradient(135deg, #f56565, #e53e3e);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-2deg); }
  75% { transform: translateX(4px) rotate(2deg); }
}

.test-case:hover .test-status.failed {
  animation: shake 0.5s ease-in-out infinite;
}

.test-info {
  flex: 1;
}

.test-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.test-message {
  font-size: 13px;
  color: var(--text-light);
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--text-dark);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text-dark);
}

.test-case:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-15px);
  animation: tooltipBounce 0.5s ease-out;
}

@keyframes tooltipBounce {
  0%, 100% { transform: translateX(-50%) translateY(-15px); }
  50% { transform: translateX(-50%) translateY(-20px); }
}

.detail-view {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.detail-header {
  margin-bottom: 32px;
  animation: slideDown 0.6s ease-out;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.back-button:hover {
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
}

.detail-content {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.detail-title-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.detail-title-section h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
}

.detail-status {
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-status.passed {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.detail-status.failed {
  background: linear-gradient(135deg, #f56565, #e53e3e);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.detail-section {
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease-out both;
}

.detail-section:nth-child(2) { animation-delay: 0.1s; }
.detail-section:nth-child(3) { animation-delay: 0.2s; }
.detail-section:nth-child(4) { animation-delay: 0.3s; }
.detail-section:nth-child(5) { animation-delay: 0.4s; }

.detail-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


.detail-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
  background: rgba(102, 126, 234, 0.05);
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.screenshot-placeholder {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border: 2px dashed var(--primary-color);
  border-radius: 12px;
  padding: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-light);
  transition: var(--transition);
}

.screenshot-placeholder:hover {
  transform: scale(1.02);
  border-color: var(--primary-dark);
}

.screenshot-placeholder svg {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  #app {
    padding: 20px;
  }

  .header {
    flex-direction: column;
    text-align: center;
  }

  .header-text h1 {
    font-size: 32px;
  }

  .header-text p {
    font-size: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .controls {
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .category-header {
    flex-wrap: wrap;
    padding: 20px;
  }

  .category-stats {
    width: 100%;
    justify-content: space-between;
  }

  .test-case {
    padding: 16px 20px;
  }

  .detail-content {
    padding: 24px;
  }

  .detail-title-section {
    flex-direction: column;
    align-items: flex-start;
  }
}

.test-type {
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease-out both;
}

.test-type:nth-child(2) { animation-delay: 0.1s; }
.test-type:nth-child(3) { animation-delay: 0.2s; }
.test-type:nth-child(4) { animation-delay: 0.3s; }
.test-type:nth-child(5) { animation-delay: 0.4s; }

.test-type h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
