/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #667eea;
}

.nav-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-tab {
  padding: 8px 16px;
  border: none;
  border-radius: 25px;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-tab.active {
  background: #667eea;
  color: white;
}

.nav-tab:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.settings-btn {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
  padding: 8px 12px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.settings-btn:hover {
  background: #667eea;
  color: white;
}

/* Dark Mode Styles */
body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
}

body.dark-mode header {
  background: rgba(26, 26, 46, 0.95);
  color: #fff;
}

body.dark-mode .nav-tab {
  color: #ccc;
}

body.dark-mode .nav-tab:hover {
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
}

body.dark-mode .card {
  background: #2d3748;
  color: #fff;
}

body.dark-mode .repo-title {
  color: #fff;
}

body.dark-mode .repo-description {
  color: #cbd5e0;
}

body.dark-mode .topic {
  background: #4a5568;
  color: #cbd5e0;
}

body.dark-mode .stat-card {
  background: #2d3748;
  color: #fff;
}

body.dark-mode .liked-repo-card {
  background: #2d3748;
  color: #fff;
}

body.dark-mode .liked-repo-title {
  color: #fff;
}

body.dark-mode .empty-state {
  color: #fff;
}

body.dark-mode .settings-btn {
  border-color: #667eea;
  color: #667eea;
}

body.dark-mode .settings-btn:hover {
  background: #667eea;
  color: #fff;
}

/* Main Content */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 80px);
}

.page {
  display: none;
  animation: fadeIn 0.5s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Styles */
.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 2rem auto;
  max-width: 800px;
  position: relative;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: 300px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image .placeholder {
  color: white;
  font-size: 3rem;
  opacity: 0.7;
}

.card-content {
  padding: 2rem;
}

.repo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.repo-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5rem;
}

.repo-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.repo-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.repo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.topic {
  background: #f0f0f0;
  color: #666;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-like {
  background: #4CAF50;
  color: white;
}

.btn-like:hover {
  background: #45a049;
  transform: translateY(-2px);
}

.btn-dislike {
  background: #f44336;
  color: white;
}

.btn-dislike:hover {
  background: #da190b;
  transform: translateY(-2px);
}

.btn-save {
  background: #9c27b0;
  color: white;
}

.btn-save:hover {
  background: #7b1fa2;
  transform: translateY(-2px);
}

.btn-gh {
  background: #333;
  color: white;
}

.btn-gh:hover {
  background: #000;
  transform: translateY(-2px);
}

.btn-collection {
  background: #FF6B35;
  color: white;
}

.btn-collection:hover {
  background: #e55a2b;
  transform: translateY(-2px);
}

/* Navigation Arrows */
.navigation-arrows {
  position: fixed;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 20px;
  z-index: 200;
  display: none;
}

.navigation-arrows.active {
  display: flex;
}

.nav-arrow {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-arrow:hover {
  background: #5a67d8;
  transform: scale(1.1);
}

.nav-arrow:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Enhanced Loading Animation */
.loading-container {
  text-align: center;
  padding: 3rem;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.loading-animation {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.loading-cube {
  position: absolute;
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 4px;
  animation: cube-rotate 2s infinite ease-in-out;
}

.loading-cube:nth-child(1) { top: 0; left: 0; animation-delay: 0s; }
.loading-cube:nth-child(2) { top: 0; right: 0; animation-delay: 0.2s; }
.loading-cube:nth-child(3) { bottom: 0; left: 0; animation-delay: 0.4s; }
.loading-cube:nth-child(4) { bottom: 0; right: 0; animation-delay: 0.6s; }

@keyframes cube-rotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.2); }
  50% { transform: rotate(180deg) scale(0.8); }
  75% { transform: rotate(270deg) scale(1.1); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1rem;
  animation: text-pulse 2s infinite;
}

@keyframes text-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.loading-dots {
  display: inline-block;
  animation: dots-bounce 1.4s infinite ease-in-out both;
}

.loading-dots:nth-child(1) { animation-delay: -0.32s; }
.loading-dots:nth-child(2) { animation-delay: -0.16s; }

@keyframes dots-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Language Icons with Flags */
.language-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.8rem;
  color: white;
}

.language-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  background-size: cover;
}

/* Activity Indicator */
.activity-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: white;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.activity-high { background: #4CAF50; }
.activity-medium { background: #FF9800; }
.activity-low { background: #f44336; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Share Button */
.share-btn {
  background: #25D366;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.share-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

/* Liked Repos Grid */
.liked-repos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.liked-repo-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.liked-repo-card:hover {
  transform: translateY(-5px);
}

.liked-repo-image {
  height: 150px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.liked-repo-content {
  padding: 1rem;
}

.liked-repo-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #333;
}

.liked-repo-date {
  color: #666;
  font-size: 0.8rem;
}

/* Loading States */
.loading {
  text-align: center;
  padding: 2rem;
  color: white;
}

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: white;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

/* Collections */
.collections-container {
  margin-top: 2rem;
}

.collection-card {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.collection-card:hover {
  transform: translateY(-3px);
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.collection-title {
  font-weight: bold;
  font-size: 1.2rem;
  color: #333;
}

.collection-count {
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
}

/* Language Evolution Chart */
.evolution-chart {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  margin-top: 2rem;
}

.chart-bar {
  height: 30px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 15px;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Dark Mode Adjustments */
body.dark-mode .collection-card {
  background: #2d3748;
  color: white;
}

body.dark-mode .collection-title {
  color: white;
}

body.dark-mode .evolution-chart {
  background: #2d3748;
  color: white;
}

/* Collection Modal */
.collection-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.collection-modal-content {
  background: white;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.collection-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.collection-modal-header h3 {
  margin: 0;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.collection-modal-body {
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.collection-modal-body p {
  margin-bottom: 1rem;
  color: #666;
}

.collection-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.collection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.collection-item:hover {
  border-color: #FF6B35;
  background: #fff5f2;
}

.collection-item i {
  color: #FF6B35;
  font-size: 1.1rem;
}

.collection-item span {
  flex: 1;
  font-weight: 500;
  color: #333;
}

.collection-count {
  background: #f0f0f0;
  color: #666;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: normal;
}

.collection-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  text-align: center;
}

/* Dark mode modal styles */
body.dark-mode .collection-modal-content {
  background: #2d3748;
  color: white;
}

body.dark-mode .collection-modal-header {
  border-bottom-color: #4a5568;
}

body.dark-mode .collection-modal-header h3 {
  color: white;
}

body.dark-mode .modal-close {
  color: #cbd5e0;
}

body.dark-mode .modal-close:hover {
  background: #4a5568;
  color: white;
}

body.dark-mode .collection-item {
  border-color: #4a5568;
  color: white;
}

body.dark-mode .collection-item:hover {
  border-color: #FF6B35;
  background: #2d3748;
}

body.dark-mode .collection-item span {
  color: white;
}

body.dark-mode .collection-count {
  background: #4a5568;
  color: #cbd5e0;
}

body.dark-mode .collection-modal-footer {
  border-top-color: #4a5568;
}

/* Collection Detail Header */
.collection-detail-header {
  margin-bottom: 2rem;
  text-align: center;
}

.collection-detail-header h2 {
  margin: 1rem 0 0.5rem 0;
  color: #333;
  font-size: 2rem;
}

.collection-detail-header p {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

body.dark-mode .collection-detail-header h2 {
  color: white;
}

body.dark-mode .collection-detail-header p {
  color: #cbd5e0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }

  .card-content {
    padding: 1.5rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .liked-repos {
    grid-template-columns: 1fr;
  }
}

/* Animation Keyframes */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
} 