:root {
    --primary: #6e40c9;
    --primary-light: #8c6bda;
    --secondary: #3dc9b0;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --danger: #e63946;
    --warning: #ffbe0b;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
  }

  header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
  }

  h1 {
    position: relative;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
  }
  
  /* Gradient underline */
  h1::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -12px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
    animation: slideInLine 1s ease-out;
  }
  
  
  /* Optional animation */
  @keyframes slideInLine {
    from {
      width: 0;
      opacity: 0;
    }
    to {
      width: 80px;
      opacity: 1;
    }
  }
  

  .subtitle {
  color: var(--gray);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--gray); /* Blinking cursor */
  animation: typing 14s steps(250, end) infinite, blink 1.3s step-end infinite;
}

/* Typing animation */
@keyframes typing {
  0% {
    width: 0;
  }
  50% {
    width: 100%;
  }
  100% {
    width: 0;
  }
}

/* Blinking cursor animation */
@keyframes blink {
  0%, 100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--gray);
  }
}


  .search-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    animation: fadeIn 1s ease-out 0.2s both;
  }

  .search-box {
    display: flex;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .search-box:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }

  .search-box:focus-within {
    box-shadow: 0 15px 35px rgba(110, 64, 201, 0.2);
  }

  #searchInput {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    font-size: 1.1rem;
    outline: none;
    background: white;
  }

  #searchInput::placeholder {
    color: var(--gray);
  }

  .search-btn {
    padding: 0 2rem;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .search-btn:hover {
    background: linear-gradient(to right, var(--primary-light), var(--primary));
  }

  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
  }

  .filter-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
  }

  .filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.8s ease-out;
  }

  .sort-options {
    display: flex;
    gap: 0.8rem;
  }

  .sort-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
  }

  .sort-btn:hover, .sort-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  #results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
  }

  .repo {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
    cursor: pointer;
  }

  .repo:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  }

  .repo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
  }

  .repo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
  }

  .repo-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .repo-name i {
    font-size: 1rem;
  }

  .repo-owner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
  }

  .owner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }

  .repo-description {
    color: var(--dark);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
  }

  .repo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--gray);
  }

  .stars {
    color: var(--warning);
  }

  .forks {
    color: var(--secondary);
  }

  .issues {
    color: var(--danger);
  }

  .repo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-light);
    padding-top: 1rem;
  }

  .repo-language {
    display: flex;
    align-items: center;
    gap: 0.3rem;
  }

  .language-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
  }

  .repo-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
  }

  .repo-link:hover {
    color: var(--primary-light);
  }

  .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
  }

  .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(110, 64, 201, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
  }

  .empty-state {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
    animation: fadeIn 0.8s ease-out;
  }

  .empty-state i {
    font-size: 3rem;
    color: var(--gray-light);
    margin-bottom: 1rem;
  }

  .empty-state p {
    color: var(--gray);
    font-size: 1.1rem;
  }

  .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    animation: fadeIn 0.8s ease-out;
  }

  .page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .page-btn:hover, .page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Repository Detail View */
  .repo-detail-container {
    display: none;
    animation: fadeIn 0.5s ease-out;
  }

  .repo-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
  }

  .back-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
  }

  .back-btn:hover {
    background: var(--primary-light);
  }

  .repo-detail-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
  }

  .repo-detail-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .repo-detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
  }

  .repo-detail-name {
    font-size: 1.8rem;
    color: var(--primary);
  }

  .repo-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0;
  }

  .repo-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .repo-detail-meta-item i {
    font-size: 1.2rem;
  }

  .repo-detail-description {
    margin: 1.5rem 0;
    line-height: 1.7;
  }

  .repo-detail-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
  }

  .download-btn {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
  }

  .download-btn:hover {
    background: var(--primary-light);
  }

  .repo-files {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
  }

  .repo-files-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
  }

  .breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    cursor: pointer;
  }

  .breadcrumb-item:hover {
    color: var(--primary);
  }

  .breadcrumb-separator {
    color: var(--gray);
  }

  .file-list {
    list-style: none;
    margin-bottom: 1rem;
  }

  .file-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
  }

  .file-item:hover {
    background: var(--gray-light);
  }

  .file-icon {
    color: var(--gray);
    width: 20px;
    text-align: center;
  }

  .file-name {
    flex: 1;
  }

  .file-size {
    color: var(--gray);
    font-size: 0.9rem;
    min-width: 80px;
    text-align: right;
  }

  /* File Viewer */
  .file-viewer {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
  }

  .file-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }

  .file-viewer-title {
    font-size: 1.2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .close-file-btn {
    padding: 0.5rem;
    background: var(--gray-light);
    color: var(--gray);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .close-file-btn:hover {
    background: var(--danger);
    color: white;
  }

  .file-content {
    max-height: 500px;
    overflow: auto;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
  }

  pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
  }

  /* Footer */
  footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
  }

  .footer-text {
    font-size: 0.9rem;
  }

  .footer-text a {
    color: var(--secondary);
    text-decoration: none;
  }

  .footer-text a:hover {
    text-decoration: underline;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    .container {
      padding: 1.5rem;
    }

    h1 {
      font-size: 2rem;
    }

    .search-box {
      flex-direction: column;
      border-radius: 12px;
    }

    #searchInput {
      border-radius: 12px 12px 0 0;
    }

    .search-btn {
      border-radius: 0 0 12px 12px;
      padding: 1rem;
    }

    #results {
      grid-template-columns: 1fr;
    }

    .repo-detail-title {
      flex-direction: column;
      align-items: flex-start;
    }

    .repo-detail-meta {
      flex-direction: column;
      gap: 1rem;
    }

    .repo-detail-actions {
      flex-direction: column;
    }

    .file-item {
      padding: 0.8rem;
    }

    .file-size {
      display: none;
    }

    .file-content {
      max-height: 300px;
    }
  }


  /* Syntax highlighting container */
.code-preview {
  position: relative;
  background: #f8f8f8;
  border-radius: 6px;
  margin: 0;
  padding: 1em;
  overflow-x: auto;
}

/* Line numbers for code */
.code-preview pre {
  counter-reset: line;
}

.code-preview code {
  counter-increment: line;
}

.code-preview code:before {
  content: counter(line);
  display: inline-block;
  width: 2em;
  padding-right: 1em;
  margin-right: 1em;
  color: #999;
  text-align: right;
  user-select: none;
}

/* Special file type icons */
.binary-file i.fas {
  font-size: 3em;
  color: #6a737d;
  display: block;
  text-align: center;
  margin: 20px 0;
}

/* Responsive media */
.file-preview img, 
.file-preview video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.file-preview audio {
  width: 100%;
}

/* File Viewer Container */
.file-viewer {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 24px;
  margin: 20px 0;
  position: relative;
  max-width: 100%;
  overflow: auto;
}

/* Loading Spinner */
.spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top: 4px solid #0366d6;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Action Buttons */
.file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 0;
  border-top: 1px solid #e1e4e8;
  margin-top: 16px;
}

.file-controls {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5da;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  background: #f6f8fa;
  transition: all 0.2s;
}

.btn:hover {
  background: #e1e4e8;
}

.download-btn {
  background: #2ea44f;
  color: white;
  border-color: rgba(27,31,35,0.15);
}

.download-btn:hover {
  background: #2c974b;
}

.copy-btn {
  background: #0366d6;
  color: white;
  border-color: rgba(27,31,35,0.15);
}

.copy-btn:hover {
  background: #035fc7;
}

/* Code Blocks */
pre code {
  display: block;
  padding: 16px;
  overflow-x: auto;
  line-height: 1.45;
  background: #f6f8fa;
  border-radius: 6px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
}

/* Markdown Content */
.markdown-content {
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.markdown-content pre {
  background: #f6f8fa;
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
}

/* Error State */
.error-state {
  text-align: center;
  padding: 40px 20px;
}

.error-icon {
  font-size: 48px;
  color: #d73a49;
  margin-bottom: 16px;
}

.error-message {
  color: #6a737d;
  margin: 16px 0;
}

.error-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}