/* Reset และ Base Styles */
html, body {
  margin: 0;
  padding: 0;
  background: #000;
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  position: fixed;
  touch-action: manipulation;
}

.app-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

/* Header Styles */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: white;
  font-weight: bold;
  font-size: 20px;
}

.header-tabs {
  display: flex;
  gap: 20px;
}

.header-tab {
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.header-tab.active {
  background: rgba(255, 255, 255, 0.15);
}

/* Video Player Styles */
.swiper {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.swiper-slide {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #000;
}

.thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity 0.3s ease;
  background-color: #000;
}

/* Action Buttons */
.right-actions {
  position: absolute;
  right: 15px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
}

.action-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.action-btn:active {
  transform: scale(0.9);
}

.action-count {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: white;
  font-weight: bold;
}

.profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  overflow: hidden;
  position: relative;
}

.profile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-btn::after {
  content: '+';
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #ff0050;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

/* Video Info Styles */
.bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  z-index: 10;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.username {
  font-weight: bold;
  font-size: 16px;
}

.follow-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.video-title {
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 10px;
  max-width: 70%;
}

.music-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.music-icon {
  width: 15px;
  height: 15px;
  background: white;
  border-radius: 50%;
  animation: spin 3s linear infinite;
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  z-index: 50;
  display: none;
  background: linear-gradient(45deg, #ff0050, #ff6b9d, #c44569, #f8b500);
  background-size: 400% 400%;
  animation: gradientBorder 0.2s ease-in-out infinite, breathe 1.3s ease-in-out infinite;
  padding: 3px;
}

.loading-spinner img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Video Progress */
.video-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  z-index: 15;
}

.video-progress {
  height: 100%;
  width: 0%;
  background: white;
  transition: width 0.1s ease;
}

/* Selection Views */
.selection-view {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 200;
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.selection-view.active {
  transform: translateX(100%);
}

.selection-view2 {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 200;
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.selection-view2.active {
  transform: translateX(-100%);
}

.selection-feed {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 200;
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.selection-feed.active {
  transform: translateX(-100%);
}

.selection-booking {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 200;
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.selection-booking.active {
  transform: translateX(-100%);
}

.selection-profile {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 200;
  transition: transform 0.4s ease;
  overflow-y: auto;
}

.selection-profile.active {
  transform: translateX(-100%);
}

/* Selection Content */
.selection-content {
  padding: 60px 20px 20px;
  color: white;
}

.selection-header {
  text-align: left;
  margin-bottom: 30px;
}

.selection-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.selection-subtitle {
  font-size: 14px;
  opacity: 0.7;
}

.selection-item {
  margin-bottom: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.selection-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

.selection-item h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: bold;
}

.selection-item p {
  margin: 0;
  font-size: 14px;
  opacity: 0.8;
}

/* Refresh Overlay */
.refresh-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
}

.refresh-overlay.active {
  display: flex;
}

.refresh-logo {
  font-size: 48px;
  margin-bottom: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

.refresh-text {
  font-size: 16px;
  opacity: 0.8;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 15px;
  margin-bottom: 20px;
}

.search-icon {
  margin-right: 10px;
  font-size: 18px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  outline: none;
}

/* Buttons */
.close-btn {
  position: fixed;
  bottom: 30px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 20px;
  width: 120px;
  height: 40px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 201;
}

.close-btn.left {
  left: 30px;
}

.close-btn.right {
  right: 30px;
}

.view-more-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 5px;
  cursor: pointer;
}

.view-more-btn:active {
  transform: scale(0.95);
}

/* Video Info Container */
.video-info-container {
  display: flex;
  gap: 15px;
  margin: 20px 0;
}

.mini-video-container {
  width: 50%;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.mini-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.video-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-details-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.video-details-description {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.4;
}

/* Iframe */
.full-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Selection Tabs */
.selection-tabs-container {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.selection-tabs {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
}

.selection-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.selection-tab.active {
  background: rgba(255, 255, 255, 0.3);
}

/* Selection Grid */
.selection-grid-container {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 10px;
}

.selection-grid {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 10px;
}

.selection-grid-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 50px;
}

.selection-grid-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

.selection-grid-item h3 {
  margin: 0 0 5px 0;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-grid-item p {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Divider */
.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 15px 0;
}

/* Iframe Loading */
.iframe-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 10;
}

.iframe-loading img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* Profile Content Styles */
.profile-content {
  padding: 60px 20px 20px;
  color: white;
  font-family: 'Sarabun', sans-serif;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.profile-username {
  font-size: 14px;
  opacity: 0.7;
}

.profile-section-title {
  font-size: 16px;
  font-weight: bold;
  margin: 20px 0 10px 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.profile-grid-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.profile-grid-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

.profile-grid-item i {
  font-size: 20px;
}

.profile-grid-item span {
  font-size: 14px;
  font-weight: 500;
}

.profile-accordion {
  margin-bottom: 10px;
}

.profile-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
}

.profile-accordion-content {
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 0 10px 10px;
}

.profile-accordion-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-accordion-item:last-child {
  border-bottom: none;
}

.profile-logout-btn {
  width: 100%;
  padding: 15px;
  background: rgba(255, 0, 80, 0.5);
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.profile-logout-btn:active {
  transform: scale(0.98);
}

/* Accordion Styles */
.menuAccordionContent {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked ~ .menuAccordionContent {
  max-height: 1000px;
}

.menuHideScrollbar::-webkit-scrollbar {
  display: none;
}

.menuHideScrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes menuFadeInUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Styles */
@media only screen and (min-width: 768px) {
  body::before {
    content: "แอพนี้ใช้งานได้เฉพาะบนมือถือเท่านั้น";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-size: 24px;
    text-align: center;
    padding: 20px;
  }
}