/* Interactive Components CSS - Racing Future Academy */

/* === VIDEO PLAYER COMPONENT === */
.video-player {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  background-color: #000;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-overlay:hover {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6));
}

.video-play-button {
  width: 72px;
  height: 72px;
  background-color: var(--primary-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(230, 34, 66, 0.4);
}

.video-play-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(230, 34, 66, 0.6);
}

.video-title {
  text-align: center;
  color: white;
}

/* Desktop - wyrównanie do lewej */
@media (min-width: 1400px) {
  .video-title {
    text-align: left;
  }
}

.video-title h3 {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 24px;
  line-height: 30px;
  margin: 0 0 8px 0;
}

.video-title p {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  margin: 0;
  opacity: 0.9;
}

.video-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.video-fullscreen-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.video-fullscreen-btn:hover {
  background-color: var(--primary-red);
}

/* === LANGUAGE SELECTOR COMPONENT === */
.language-selector {
  position: relative;
  display: inline-block;
}

.language-selector-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  color: var(--dark-gray);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-ui);
  font-size: 14px;
  min-width: 100px;
}

.language-selector-button:hover {
  background-color: rgba(230, 34, 66, 0.05);
}

.current-language {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
}

.flag-icon {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--white);
  border: 1px solid var(--text-gray);
  border-radius: 4px;
  box-shadow: var(--shadow-elevated);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownSlide 0.2s ease-out;
}

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

.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background-color: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-ui);
  font-size: 14px;
}

.language-option:hover:not(:disabled) {
  background-color: rgba(230, 34, 66, 0.05);
}

.language-option.active {
  background-color: rgba(230, 34, 66, 0.1);
  color: var(--primary-red);
}

.language-option:disabled {
  cursor: default;
}

.check-icon {
  margin-left: auto;
  color: var(--primary-red);
}

/* === SCROLL TO TOP COMPONENT === */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top-button {
  width: 56px;
  height: 56px;
  background-color: var(--primary-red);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-elevated);
  transition: all 0.3s ease;
}

.scroll-to-top-button:hover {
  background-color: #d91e3e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 34, 66, 0.4);
}

.scroll-to-top-button:active {
  transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 16px;
    right: 16px;
  }
  
  .scroll-to-top-button {
    width: 48px;
    height: 48px;
  }
  
  .language-selector-button {
    min-width: 100px;
    font-size: 13px;
  }
  
  .video-play-button {
    width: 60px;
    height: 60px;
  }
  
  .video-title h3 {
    font-size: 20px;
    line-height: 26px;
  }
  
  .video-title p {
    font-size: 14px;
    line-height: 20px;
  }
}

/* Loading states for app initialization */
.app-loaded {
  /* Add any app-loaded specific styles here */
}

.app-loaded .loading-initial {
  display: none;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .video-play-button,
  .scroll-to-top-button,
  .language-dropdown,
  .dropdown-arrow {
    transition: none;
    animation: none;
  }
  
  .loading-spinner {
    animation: none;
    border-top-color: var(--primary-red);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .video-overlay {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8));
  }
  
  .language-selector-button {
    /* No border needed */
  }
  
  .language-dropdown {
    border-color: var(--dark-gray);
  }
}
