:root {
  --primary-color: #4e54c8;
  --secondary-color: #3f45b6;
  --background-color: #f5f5f5;
  --text-color: #646464;
  --card-background: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --glow-hue: 222deg;
  --shadow-hue: 180deg;
  --spring-easing: linear(
    0,
    0.002,
    0.01 0.9%,
    0.038 1.8%,
    0.156,
    0.312 5.8%,
    0.789 11.1%,
    1.015 14.2%,
    1.096,
    1.157,
    1.199,
    1.224 20.3%,
    1.231,
    1.231,
    1.226,
    1.214 24.6%,
    1.176 26.9%,
    1.057 32.6%,
    1.007 35.5%,
    0.984,
    0.968,
    0.956,
    0.949 42%,
    0.946 44.1%,
    0.95 46.5%,
    0.998 57.2%,
    1.007,
    1.011 63.3%,
    1.012 68.3%,
    0.998 84%,
    1
  );
  --spring-duration: 1.33s;
  --tab-offset: 2px;
  --tab-range-min: 1;
  --tab-range-max: 3;
  --tab-range: var(--tab-range-min);
  --tab-slider-thumb-size: 32px;
  --tab-track-height: 36px;
  --tab-progress-bg: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
}

p {
  margin: 0;
  padding: 0;
}

hr {
  background-color: #e9e9e9;
  color: #e9e9e9;
  border-color: #e9e9e9;
  margin: 20px 0;
}

@property --shimmer {
  syntax: '<angle>';
  inherits: false;
  initial-value: 33deg;
}

@keyframes shimmer {
  0% {
    --shimmer: 0deg;
  }
  100% {
    --shimmer: 360deg;
  }
}

@keyframes shine {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes text {
  0% {
    background-position: 100% center;
  }
  100% {
    background-position: -100% center;
  }
}

body {
  font-family: 'Anek Gujarati', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  color: var(--text-color);
}

#left-panel {
  /* width: 300px;
  padding: 20px;
  background-color: var(--card-background);
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  left: 0;
  top: 0; */
  width: 250px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: #f8f9fa;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease-in-out;
}

#left-panel.hidden {
  transform: translateX(-100%);
}

#search-container {
  width: 100%;
  position: relative;
  margin: 20px auto;
  max-width: 500px;
}

#search-results {
  width: 100%;
  margin-top: 20px;
}

@keyframes spin {
  0% {
    transform: translateY(-50%) rotate(0deg);
  }
  100% {
    transform: translateY(-50%) rotate(360deg);
  }
}

h3 {
  align-self: flex-start;
  width: 100%;
}

.competitor-result {
  cursor: pointer;
}

.back-button-container {
  display: flex;
  justify-content: flex-start;
  margin-left: 10px;
}

.back-button {
  max-height: 45px;
}

#app-list {
  width: 100%;
  padding: 0;
  list-style-type: none;
}

#app-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 10px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

#app-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.app-icon,
.app-icon-header {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.app-icon {
  margin-right: 10px;
}

.app-title-header {
  color: #646464;
  font-weight: normal;
  font-size: 20px;
}

#app-list li span:not(.remove-app) {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remove-app {
  color: #ff4d4d;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.remove-app:hover {
  color: #ff0000;
  transform: scale(1.1);
}

#main-content {
  width: 100%;
  margin: 10px auto;
  margin-left: 0;
  transition: margin-left 0.3s ease-in-out;
}

#main-content.sidebar-visible {
  padding-left: 260px;
}

.content-container {
  max-width: 1000px;
  width: 100%;
}

#app-list li {
  cursor: pointer;
  padding: 15px;
  margin-bottom: 10px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

#app-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.review {
  background-color: #f9f9f9;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #e9e9e9;
  transition: all 0.3s ease;
}

.review:hover {
  transform: translateY(-2px);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.review-title,
.review-by {
  color: #404040;
  font-size: 16px;
  font-weight: 600;
}

.review-by {
  margin-bottom: 0 !important;
}

.review-text {
  font-size: 16px;
  margin-top: 20px;
  margin-bottom: 25px;
}

.review-date {
  font-family: 14px;
}

h2,
h3 {
  color: var(--primary-color);
  margin-top: 0;
}

.review h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review h3 .stars {
  font-size: 0.8em;
  color: #ffd700;
}

.score {
  font-weight: bold;
  color: var(--secondary-color);
}

.country-flag {
  width: 24px;
  height: 18px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 4px;
}

.loading-message {
  text-align: center;
  font-size: 18px;
  color: #666;
  margin-top: 20px;
}

.remove-app {
  color: #ff4d4d;
  margin-left: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.remove-app:hover {
  color: #ff0000;
  transform: scale(1.1);
}

.rating-summary {
  border: 1px solid #5e24d9;
  border-radius: 12px;
  background-color: #f9f9f9;
}

.rating-summary-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-summary-tab {
  cursor: pointer;
  padding: 20px;
  flex: 0 1 100%;
  text-align: center;
  font-weight: 600;
  font-family: 'Anek Gujarati';
  font-size: 16px;
  background: linear-gradient(
    90deg,
    rgba(35, 97, 217, 0.15) 0%,
    rgba(94, 36, 217, 0.15) 100%
  );
  border: 1px solid #5e24d9;
  border-top: 0;
}

.rating-summary-tab:last-child {
  border-right: 0;
}

.rating-summary-tab:first-child {
  border-left: 0;
}

.rating-summary-tab.active {
  background: #f9f9f9;
  border-radius: 20px;
  border: 0;
}

.rating-summary-tab.active span {
  position: relative;
}

.rating-summary-tab.active span::before {
  content: '';
  position: absolute;
  bottom: -10px;
  width: 100%;
  height: 3px;
  background: linear-gradient(270deg, #5e25d9 0%, #2461d9 100%);
  border-radius: 8px;
}

.rating-content {
  padding: 10px 30px;
}

.rating-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin-bottom: 20px;
}

.rating-with-stars {
  display: flex;
  align-items: center;
  gap: 20px;
}

.rating-based-on {
  color: #646464;
  font-size: 14px;
  font-family: 'Anek Gujarati';
}

#average-rating {
  font-size: 48px;
  font-weight: bold;
}

.stars {
  font-size: 24px;
  color: var(--primary-color);
  unicode-bidi: bidi-override;
  direction: ltr;
  text-align: left;
  position: relative;
}

.stars::before {
  content: '★★★★★';
  letter-spacing: 3px;
  background: linear-gradient(
    90deg,
    #4e54c8 var(--percent),
    #ccc var(--percent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: absolute;
  left: -10px;
}

.rating-bar {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.rating-label {
  text-align: right;
  margin-right: 10px;
  white-space: nowrap;
  font-family: 'Anek Gujarati';
  font-weight: bold;
  font-size: 16px;
}

.rating-progress {
  flex-grow: 1;
  height: 15px;
  border: 1px solid #e9e9e9;
  border-radius: 8px;
  overflow: hidden;
}

.rating-progress-fill {
  height: 100%;
  /* background-color: var(--primary-color); */
  background: linear-gradient(270deg, #5e25d9 0%, #2461d9 100%);
  transition: width 0.5s ease-in-out;
  width: 0;
  animation: fillBar 1s ease-out forwards;
}

.review-rating-summary-title {
  text-align: center;
  margin: 25px 0;
}

@keyframes fillBar {
  from {
    width: 0;
  }
  to {
    width: var(--width);
  }
}

.rating-count {
  font-family: 'Anek Gujarati';
  font-weight: 500;
  font-size: 16px;
  text-align: left;
  margin-left: 10px;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#word-cloud {
  margin-bottom: 20px;
  padding: 20px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

#tabs {
  display: flex;
  margin-bottom: 20px;
  margin-top: 20px;
  background-color: transparent;
  overflow: hidden;
  box-shadow: none;
  gap: 10px;
}

.tab-button {
  flex: 1;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(35, 97, 217, 0.15) 0%,
    rgba(94, 36, 217, 0.15) 100%
  );
}

.tab-button:hover {
  transform: translateY(-2px);
}

.tab-button.active {
  background: linear-gradient(90deg, #2361d9 0%, #5e24d9 100%);
}

.tab-button.active span {
  color: white;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  background: transparent;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

#word-cloud-container {
  text-align: center;
  padding: 20px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 400px;
  overflow: hidden;
}

#summary-container {
  padding: 30px;
  padding-top: 0;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

#summary-container h2 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-top: 30px;
}

#summary-container p,
#summary-container ul {
  margin: 15px 0;
}

#summary-container ul {
  padding-left: 20px;
}

#summary-container li {
  margin-bottom: 10px;
}

.loader {
  right: 16px;
  top: 10px;
  transform: unset;
}

.analyze-loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.generating-text {
  text-align: center;
  font-size: 18px;
  color: var(--primary-color);
  margin-top: 10px;
}

#analyze-reviews-btn {
  align-items: center;
  display: inline-flex;
  gap: 9px;
}

#tabs {
  display: flex;
  margin-bottom: 20px;
  background-color: transparent;
  overflow: hidden;
  box-shadow: none;
  gap: 10px;
}

#filter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#rating-filter {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  background-color: white;
}

#rating-filter {
  width: 120px;
}

#review-search {
  flex-grow: 1;
  margin-left: 15px;
}

#review-search:focus,
#rating-filter:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(78, 84, 200, 0.1);
}

.highlight {
  background-color: yellow;
  font-weight: bold;
}

/* Color palette for ratings */
/* .rating-5 {
  background-color: #4caf50;
}
.rating-4 {
  background-color: #8bc34a;
}
.rating-3 {
  background-color: #ffeb3b;
}
.rating-2 {
  background-color: #ff9800;
}
.rating-1 {
  background-color: #f44336;
} */

.tab-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-bottom: 20px;
  container-name: change-datalist;
}

#tab-range {
  --tab-track-width: calc((100% - var(--tab-offset) * 2));
  --tab-size: calc(var(--tab-track-width) / 3);
  --tab-progress: (var(--tab-range) - var(--tab-range-min)) /
    (var(--tab-range-max) - var(--tab-range-min));
  --tab-progress-length: calc(
    (var(--tab-track-width) - var(--tab-size)) * var(--tab-progress) +
      var(--tab-offset)
  );

  position: relative;
  appearance: none;
  background: none;
  width: 100%;
  z-index: 2;
}

#tab-range::after {
  pointer-events: none;
  content: '';
  border-radius: 6px;
  background: var(--tab-progress-bg) no-repeat;
  font-size: 16px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  width: var(--tab-size);
  top: 2px;
  bottom: 2px;
  transition: left 0.4s, scale 0.3s, top 0.3s, bottom 0.3s;
  left: var(--tab-progress-length);
}

#tab-range::-webkit-slider-thumb {
  appearance: none;
  background: none;
  cursor: pointer;
  width: calc(100% / 3);
  height: 100%;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 7px;
  opacity: 0;
}

#tab-range::-webkit-slider-runnable-track {
  appearance: none;
  background-color: var(--card-background);
  height: var(--tab-track-height);
  border-radius: 6px;
  padding: 2px var(--tab-offset);
}

.tab-name {
  appearance: none;
  display: flex;
  height: 100%;
  align-items: center;
  position: absolute;
  width: 100%;
  padding: 2px var(--tab-offset);
  pointer-events: none;
  list-style: none;
  margin: 0;
}

.tab-name li {
  flex: 1;
  text-align: center;
  color: black; /* Default color for inactive tabs */
  transition: color 0.3s;
  z-index: 3; /* Ensure text is above the sliding background */
  font-weight: bold;
}

#tab-range:active::after {
  scale: 0.95;
}

@container change-datalist style(--tab-range: 1) {
  .tab-name li[value='1'] {
    color: white;
  }
}

@container change-datalist style(--tab-range: 2) {
  .tab-name li[value='2'] {
    color: white;
  }
}

@container change-datalist style(--tab-range: 3) {
  .tab-name li[value='3'] {
    color: white;
  }
}
