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

body {
  font-family: 'YouTube Sans', 'Roboto', Arial, sans-serif;
  background: #000;
  color: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  padding-bottom: 40px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

.youtube-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.yt-icon {
  width: 32px;
  height: 24px;
  background: #FF0000;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent #fff;
}

.yt-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.profile-button {
  margin-left: auto;
  background: #FF0000;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-button:active {
  transform: scale(0.95);
  background: #CC0000;
}

.export-button {
  margin-left: auto;
  background: #00A8E8;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-button:hover {
  background: #0096D1;
}

.export-button:active {
  transform: scale(0.95);
  background: #0084BA;
}

.help-button {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.help-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.help-button:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

/* Main Title */
.main-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  padding: 32px 20px 24px;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #FF0000 0%, #FF00FF 33%, #00D9FF 66%, #00FF88 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation: textPulse 3s ease-in-out infinite;
}

.main-title::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, rgba(255, 0, 255, 0.3) 33%, rgba(0, 217, 255, 0.2) 66%, transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
  animation: haloPulse 3s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes haloPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.9;
  }
}

@keyframes textPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.8));
  }
}

/* Progress Bar */
.progress-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 20px 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF0000, #FF6B6B);
  width: 0%;
  transition: width 0.3s ease;
}

/* Category Section */
.category-section {
  margin: 30px 20px;
  position: relative;
}

.category-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  opacity: 0.7;
  z-index: 0;
  border-radius: 16px 16px 0 0;
}

.category-card.music::before {
  background: linear-gradient(135deg, #FFE500 0%, #00D9FF 50%, #0047FF 100%);
}

.category-card.food::before {
  background: linear-gradient(135deg, #FF6600 0%, #FF9933 50%, #FFCC99 100%);
}

.category-card.games::before {
  background: linear-gradient(135deg, #FF5F00 0%, #FF007A 50%, #7B00B8 100%);
}

.category-card.funniest::before {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF6347 100%);
}

.category-card.movie::before {
  background: linear-gradient(135deg, #FF006E 0%, #C200FF 50%, #5E00DB 100%);
}

.category-card.tvshow::before {
  background: linear-gradient(135deg, #8B00FF 0%, #4B0082 50%, #1E3A8A 100%);
}

.category-card.anime::before {
  background: linear-gradient(135deg, #FF1493 0%, #9400D3 50%, #4B0082 100%);
}

.category-card.bestlongform::before {
  background: linear-gradient(135deg, #1E90FF 0%, #00BFFF 50%, #87CEEB 100%);
}

.category-card.bestshortform::before {
  background: linear-gradient(135deg, #FF6347 0%, #FF4500 50%, #FFA07A 100%);
}

.category-card.fashion::before {
  background: linear-gradient(135deg, #FF0099 0%, #FF66CC 50%, #FFB3E6 100%);
}

.category-card.beauty::before {
  background: linear-gradient(135deg, #FF1493 0%, #FF69B4 50%, #FFB6C1 100%);
}

.category-card.happiness::before {
  background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 50%, #FFF59D 100%);
}

.category-card.mostloved::before {
  background: linear-gradient(135deg, #FF0066 0%, #FF3385 50%, #FF99CC 100%);
}

.category-card.topcreator::before {
  background: linear-gradient(135deg, #00FFB3 0%, #0099FF 50%, #7A00FF 100%);
}

.category-card.favorites::before {
  background: linear-gradient(135deg, #FF0080 0%, #FF8C00 50%, #FFCC00 100%);
}

.category-card.mostuseful::before {
  background: linear-gradient(135deg, #00CC44 0%, #00FF88 50%, #66FFBB 100%);
}

.category-card.mosthated::before {
  background: linear-gradient(135deg, #8B0000 0%, #B22222 50%, #DC143C 100%);
}

.category-card.podcast::before {
  background: linear-gradient(135deg, #6600CC 0%, #9933FF 50%, #CC99FF 100%);
}

.category-card.news::before {
  background: linear-gradient(135deg, #0066FF 0%, #00A3FF 50%, #66D9FF 100%);
}

.category-card.learning::before {
  background: linear-gradient(135deg, #9933FF 0%, #CC66FF 50%, #E699FF 100%);
}

.category-card.courses::before {
  background: linear-gradient(135deg, #FF9900 0%, #FFBB33 50%, #FFDD99 100%);
}

.category-card.playable::before {
  background: linear-gradient(135deg, #00CCFF 0%, #66E6FF 50%, #B3F0FF 100%);
}

.category-header {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.category-icon {
  width: 40px;
  height: 40px;
  background: #FF0000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
}

.category-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
}

.category-text {
  flex: 1;
}

.category-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.category-subtitle {
  font-size: 14px;
  opacity: 0.8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Video Slots */
.video-slots {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.video-slot-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-slot-wrapper .slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: transparent;
}

.video-slot {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.video-slot.has-video {
  cursor: pointer;
}

.video-slot.has-video:active {
  transform: scale(0.98);
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
}

.slot-number {
  font-size: 16px;
  font-weight: 700;
  opacity: 0.9;
  min-width: 24px;
}

.add-button {
  background: #FF0000;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-button:active {
  transform: scale(0.95);
  background: #CC0000;
}

.slot-content {
  padding: 16px;
}

.video-thumbnail-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 0, 0, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.video-slot.has-video:hover .play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

.video-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  opacity: 0.5;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 14px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-content.help-modal {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: all 0.2s ease;
}

.modal-input:focus {
  border-color: #FF0000;
  background: rgba(255, 255, 255, 0.15);
}

.modal-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.modal-info {
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin: 0;
}

.info-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.info-text strong {
  color: #FF9500;
  font-weight: 600;
}

.modal-buttons {
  display: flex;
  gap: 12px;
}

.modal-button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-button.primary {
  background: #FF0000;
  color: #fff;
}

.modal-button.primary:active {
  background: #CC0000;
  transform: scale(0.98);
}

.modal-button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-button.secondary:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

.remove-button {
  background: rgba(255, 0, 0, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 0, 0, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  position: relative;
}

.remove-button:hover {
  background: rgba(255, 0, 0, 1);
  border-color: rgba(255, 0, 0, 0.8);
}

.remove-button:active {
  background: #CC0000;
  transform: scale(0.95);
}

/* Help Modal Styles */
.help-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-number {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #FF0000, #FF00FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.step-text {
  flex: 1;
}

.step-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: #fff;
}

.step-text p {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.help-note {
  background: rgba(0, 168, 232, 0.1);
  border: 1px solid rgba(0, 168, 232, 0.3);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 8px;
}

.help-note strong {
  color: #00A8E8;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 20px;
  opacity: 0.6;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #FF0000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Profile Page */
.profile-page {
  min-height: 100vh;
  padding-bottom: 40px;
}

.back-button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-button:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.15);
}

.profile-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  padding: 24px 20px;
  letter-spacing: -1px;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .profile-content {
    flex-direction: row;
  }
  
  .profile-questions {
    flex: 1;
  }
  
  .profile-chart {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #FF0000;
}

.profile-questions {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.question-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-label {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.question-description {
  font-size: 13px;
  opacity: 0.6;
  margin-top: 4px;
}

.profile-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-select:focus {
  border-color: #FF0000;
  background: rgba(255, 255, 255, 0.15);
}

.profile-select option {
  background: #1a1a1a;
  color: #fff;
}

/* Toggle Switch */
.toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #FF0000;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Chart */
.profile-chart {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 0, 0, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 0, 0, 0.3);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #FF0000;
  text-align: right;
}

.combo-comment {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 105, 180, 0.15));
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #FFD700;
  font-weight: 600;
  text-align: center;
  font-style: italic;
  display: none;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

#profile-chart {
  max-width: 100%;
  height: auto;
}

.viewer-type {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(255, 0, 255, 0.1));
  border: 2px solid rgba(255, 0, 0, 0.3);
  border-radius: 12px;
  text-align: center;
  display: none;
}

.viewer-type-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #FF0000;
}

.viewer-type-description {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
