:root {
  --bg-color: #0d0d0d;
  --panel-bg: rgba(255, 255, 255, 0.05); /* Glass bg */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --accent-color: #3b82f6; /* Blue */
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
  --border-color: rgba(255, 255, 255, 0.1);
  --hover-bg: rgba(255, 255, 255, 0.08);
  --search-placeholder: rgba(255, 255, 255, 0.3);
  --expand-icon-color: rgba(255, 255, 255, 0.5);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-x: hidden;
  position: relative;
}

/* Background Effects */
.background-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(168, 85, 247, 0.1) 50%, transparent 100%);
  z-index: -1;
  filter: blur(100px);
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 60px;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 10px;
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 40px auto 0;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--search-placeholder);
  font-style: normal;
}

#plugin-search {
  width: 100%;
  padding: 16px 20px 16px 50px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

#plugin-search:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

/* SEO Description */
.seo-description {
  max-width: 800px;
  margin: 15px auto 30px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

.seo-description strong {
  font-weight: 600;
}

/* Table Design */
.table-container {
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
}

.plugin-table {
  width: 100%;
  border-collapse: collapse;
}

.plugin-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.plugin-table thead tr {
  display: flex;
  width: 100%;
}

.plugin-table th {
  text-align: left;
  padding: 20px;
  flex: 1; /* Match td flex */
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Row Styling */
.plugin-row {
  cursor: pointer;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.plugin-table td {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

/* Explicit width alignment for Desktop Flex Table */
.plugin-table th:nth-child(1), .plugin-row > td:nth-child(1) { width: 35%; flex: none; }
.plugin-table th:nth-child(2), .plugin-row > td:nth-child(2) { width: 25%; flex: none; }
.plugin-table th:nth-child(3), .plugin-row > td:nth-child(3) { width: 25%; flex: none; }
.plugin-table th:nth-child(4), .plugin-row > td:nth-child(4) { width: 15%; flex: none; text-align: right; }

/* Ensure the details container forces a line break in the flex row */
.details-container {
  flex-basis: 100%;
}

.plugin-row:hover {
  background-color: var(--hover-bg);
}

/* Expand Icon (Circle with Chevron) */
.expand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.7rem;
  transition: var(--transition);
  margin-right: 12px;
}

.expanded .expand-icon {
  transform: rotate(90deg);
  background: var(--accent-gradient);
}

.plugin-info {
  display: flex;
  align-items: center;
  font-weight: 600;
  gap: 8px;
}

.author-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 6px; /* Slightly more square like screenshot */
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Action Button */
.btn-copy {
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 8px 24px;
  border-radius: 8px; /* Slightly rounded edges as per screenshot */
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}

.btn-copy:active {
  transform: translateY(0);
}

/* Details Container (Expanded inside row) */
.details-container {
  display: none;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
}

.plugin-row {
  /* Needed for absolute positioning of details container if breaking out of table flow */
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.plugin-table td {
  flex: 1;
}

.plugin-row.expanded .details-container {
  display: block;
  flex-basis: 100%;
  animation: fadeIn 0.3s ease;
}

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

.details-content {
  padding: 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 400;
}

.detail-value span {
  color: #a855f7;
}

/* Sub-Plugins Grid View */
.sub-plugins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.sub-plugin-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: var(--transition);
}

.sub-plugin-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.sub-plugin-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--text-primary);
}

.sub-plugin-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-plugin-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.sub-plugin-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.sub-plugin-meta {
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.sub-plugin-meta .label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}

.sub-plugin-meta .value {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Specific to Yoru expansion */
.details-content.has-sub-plugins {
  padding: 20px;
}

/* Footer & Disclaimer */
.footer {
  margin-top: 60px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.disclaimer {
  max-width: 800px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.disclaimer p {
  margin-bottom: 12px;
}

.disclaimer strong {
  color: var(--text-primary);
  font-weight: 600;
}

.footer-links {
  margin-top: 25px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865f2;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  padding: 12px 28px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
}

.footer-link:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.3);
}

.footer-link .discord-logo {
  width: 20px;
  height: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }

  .title {
    font-size: 2.2rem;
  }
  
  .subtitle {
    font-size: 1rem;
    padding: 0 10px;
  }

  .plugin-table thead {
    display: none;
  }
  
  .plugin-table, .plugin-table tbody {
    display: block;
    width: 100%;
  }

  .plugin-row {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0 !important; /* Reset padding, we'll pad the internals */
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden; /* Keep children inside border radius */
  }

  /* Target the direct children of the row EXCEPT the details container */
  .plugin-row > td {
    border: none;
    padding: 12px 15px;
    text-align: left !important;
    width: 100% !important;
    flex: none !important; /* override desktop flex */
  }
  
  .plugin-row > td:nth-child(2) {
      padding-top: 0;
      color: var(--text-secondary);
      font-size: 0.9rem;
  }
  
  .plugin-row > td:nth-child(4) {
      padding-top: 0;
  }

  /* Expanded Row on Mobile (Now inside the card) */
  .details-container {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
  }

  .details-content {
    padding: 15px;
  }

  .sub-plugins-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sub-plugin-card {
    padding: 10px;
  }

  .footer-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.8rem;
  }
  
  .logo {
    width: 40px;
    height: 40px;
  }
}

/* Global Navigation */
.global-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.2rem;
}

.nav-brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 8px 12px;
  border-radius: 8px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(168, 85, 247, 0.15); /* Subtle purple background */
}

/* Download Cards */
.download-section {
  margin: 40px 0;
}

.download-cards-container {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.download-card {
  flex: 1;
  min-width: 300px;
  max-width: 450px;
  padding: 40px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(168, 85, 247, 0.3);
}

.card-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-app-icon {
  width: 50px;
  height: 50px;
}

.download-card h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.platform-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 30px;
}

.btn-download {
  display: inline-block;
  width: 100%;
  padding: 16px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-download:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

/* Downloader Section */
.downloader-section {
  display: flex;
  justify-content: center;
  margin: 10px 0 50px;
}

.downloader-box {
  background: var(--panel-bg);
  border: 1px solid #f97316; /* Orange border like the image */
  border-radius: var(--radius);
  padding: 20px 30px;
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
}

.downloader-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.downloader-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.downloader-code {
  font-size: 3rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.btn-copy-downloader {
  background: #f97316; /* Orange button */
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1.1rem;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.btn-copy-downloader:hover {
  background: #ea580c;
  transform: translateY(-2px);
}

.btn-copy-downloader.copied {
  background: #22c55e;
}

/* Progress Modal */
.progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none; /* toggled by JS to flex */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.progress-modal.hidden {
  display: none !important;
}

.modal-content {
  background: var(--panel-bg);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 10px;
  transition: width 0.05s linear;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

#progress-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #000000;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
  z-index: 1000;
}

.hidden {
  opacity: 0;
  bottom: 20px;
  pointer-events: none;
}
