/* Tapwin SBS - Mobile First Gaming Platform */
/* CSS Classes with .tw- prefix */

/* ===== COLOR SCHEME ===== */
:root {
  --tw-primary: #FF6B35;        /* Vibrant Orange */
  --tw-secondary: #004E89;      /* Deep Navy Blue */
  --tw-accent: #FFD23F;         /* Golden Yellow */
  --tw-dark: #1A1A2E;           /* Midnight Dark */
  --tw-light: #F5F5F5;          /* Soft Light Gray */
  --tw-success: #28A745;        /* Success Green */
  --tw-danger: #DC3545;         /* Danger Red */
  --tw-warning: #FFC107;        /* Warning Yellow */
  --tw-info: #17A2B8;           /* Info Cyan */
  --tw-white: #FFFFFF;
  --tw-black: #000000;
  --tw-text: #333333;
  --tw-text-light: #666666;
  --tw-border: #E0E0E0;
  --tw-shadow: rgba(0, 0, 0, 0.1);
  --tw-shadow-hover: rgba(0, 0, 0, 0.2);
  --tw-gradient-1: linear-gradient(135deg, #FF6B35 0%, #FFD23F 100%);
  --tw-gradient-2: linear-gradient(135deg, #004E89 0%, #1A1A2E 100%);
  --tw-gradient-3: linear-gradient(135deg, #28A745 0%, #20C997 100%);
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--tw-text);
  background-color: var(--tw-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT UTILITIES ===== */
.tw-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 16px;
}

.tw-flex {
  display: flex;
}

.tw-flex-col {
  flex-direction: column;
}

.tw-items-center {
  align-items: center;
}

.tw-justify-center {
  justify-content: center;
}

.tw-justify-between {
  justify-content: space-between;
}

.tw-grid {
  display: grid;
}

.tw-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.tw-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tw-grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.tw-gap-2 {
  gap: 8px;
}

.tw-gap-3 {
  gap: 12px;
}

.tw-gap-4 {
  gap: 16px;
}

.tw-text-center {
  text-align: center;
}

.tw-text-left {
  text-align: left;
}

.tw-text-right {
  text-align: right;
}

/* ===== HEADER STYLES ===== */
.tw-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--tw-gradient-2);
  padding: 12px 16px;
  box-shadow: 0 2px 8px var(--tw-shadow);
  transition: all 0.3s ease;
}

.tw-header.tw-scrolled {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
}

.tw-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 430px;
  margin: 0 auto;
}

.tw-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--tw-accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--tw-gradient-1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tw-white);
  font-size: 18px;
}

.tw-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tw-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tw-btn-primary {
  background: var(--tw-gradient-1);
  color: var(--tw-white);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.tw-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.tw-btn-secondary {
  background: var(--tw-white);
  color: var(--tw-secondary);
  border: 2px solid var(--tw-secondary);
}

.tw-btn-secondary:hover {
  background: var(--tw-secondary);
  color: var(--tw-white);
}

.tw-menu-toggle {
  background: none;
  border: none;
  color: var(--tw-white);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* ===== MOBILE MENU ===== */
.tw-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--tw-dark);
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.tw-mobile-menu.tw-active {
  right: 0;
}

.tw-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tw-menu-overlay.tw-active {
  opacity: 1;
  visibility: visible;
}

.tw-menu-header {
  padding: 20px;
  background: var(--tw-gradient-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tw-menu-close {
  background: none;
  border: none;
  color: var(--tw-white);
  font-size: 24px;
  cursor: pointer;
}

.tw-menu-nav {
  padding: 20px 0;
}

.tw-menu-item {
  display: block;
  padding: 16px 20px;
  color: var(--tw-white);
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
}

.tw-menu-item:hover,
.tw-menu-item.tw-active {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--tw-accent);
  color: var(--tw-accent);
}

/* ===== HERO CAROUSEL ===== */
.tw-hero {
  margin-top: 60px;
  position: relative;
  overflow: hidden;
  background: var(--tw-dark);
}

.tw-carousel-container {
  display: flex;
  transition: transform 0.5s ease;
}

.tw-carousel-slide {
  min-width: 100%;
  position: relative;
}

.tw-carousel-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.tw-carousel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: var(--tw-white);
}

.tw-carousel-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--tw-accent);
}

.tw-carousel-description {
  font-size: 14px;
  opacity: 0.9;
}

.tw-carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.tw-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tw-carousel-dot.tw-active {
  background: var(--tw-accent);
  transform: scale(1.2);
}

/* ===== GAME FILTER ===== */
.tw-game-filter {
  padding: 20px 16px;
  background: var(--tw-white);
  border-bottom: 1px solid var(--tw-border);
}

.tw-filter-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.tw-filter-buttons::-webkit-scrollbar {
  display: none;
}

.tw-filter-btn {
  padding: 10px 16px;
  border: 2px solid var(--tw-border);
  background: var(--tw-white);
  color: var(--tw-text);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tw-filter-btn.tw-active {
  background: var(--tw-primary);
  color: var(--tw-white);
  border-color: var(--tw-primary);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* ===== GAME GRID ===== */
.tw-games-section {
  padding: 20px 16px;
}

.tw-section-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--tw-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tw-game-card {
  background: var(--tw-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--tw-shadow);
  transition: all 0.3s ease;
  cursor: pointer;
}

.tw-game-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px var(--tw-shadow-hover);
}

.tw-game-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--tw-gradient-2);
}

.tw-game-info {
  padding: 12px;
}

.tw-game-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tw-text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-game-category {
  font-size: 12px;
  color: var(--tw-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tw-play-btn {
  width: 100%;
  padding: 8px;
  background: var(--tw-gradient-1);
  color: var(--tw-white);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.tw-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* ===== CONTENT SECTIONS ===== */
.tw-content-section {
  padding: 32px 16px;
  background: var(--tw-white);
  margin-bottom: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--tw-shadow);
}

.tw-content-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--tw-dark);
  margin-bottom: 16px;
  text-align: center;
}

.tw-content-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--tw-text);
  margin-bottom: 16px;
}

.tw-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.tw-feature-item {
  text-align: center;
  padding: 16px;
  background: var(--tw-light);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tw-feature-item:hover {
  background: var(--tw-primary);
  color: var(--tw-white);
  transform: translateY(-2px);
}

.tw-feature-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.tw-feature-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tw-feature-desc {
  font-size: 12px;
  opacity: 0.8;
}

/* ===== PROMOTION BANNER ===== */
.tw-promo-banner {
  background: var(--tw-gradient-3);
  color: var(--tw-white);
  padding: 20px 16px;
  border-radius: 12px;
  text-align: center;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.tw-promo-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: tw-shine 3s infinite;
}

@keyframes tw-shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.tw-promo-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.tw-promo-text {
  font-size: 14px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.tw-promo-btn {
  background: var(--tw-white);
  color: var(--tw-success);
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.tw-promo-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ===== BOTTOM NAVIGATION ===== */
.tw-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--tw-gradient-2);
  padding: 12px 0;
  box-shadow: 0 -2px 8px var(--tw-shadow);
  z-index: 1000;
  display: none;
}

.tw-bottom-nav-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 430px;
  margin: 0 auto;
}

.tw-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: 60px;
  min-height: 60px;
  justify-content: center;
}

.tw-bottom-nav-item:hover,
.tw-bottom-nav-item.tw-active {
  color: var(--tw-accent);
  background: rgba(255, 210, 63, 0.1);
  transform: translateY(-2px);
}

.tw-bottom-nav-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.tw-bottom-nav-text {
  font-size: 10px;
  font-weight: 500;
}

/* ===== FOOTER ===== */
.tw-footer {
  background: var(--tw-dark);
  color: var(--tw-white);
  padding: 32px 16px 100px;
  text-align: center;
}

.tw-footer-content {
  max-width: 430px;
  margin: 0 auto;
}

.tw-footer-section {
  margin-bottom: 24px;
}

.tw-footer-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--tw-accent);
}

.tw-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.tw-footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s ease;
}

.tw-footer-link:hover {
  color: var(--tw-accent);
}

.tw-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .tw-bottom-nav {
    display: block;
  }

  main {
    padding-bottom: 80px;
  }
}

@media (min-width: 769px) {
  .tw-container {
    max-width: 1200px;
  }

  .tw-games-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .tw-feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .tw-carousel-slide img {
    height: 300px;
  }
}

/* ===== LOADING STATES ===== */
.tw-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tw-loading.tw-active {
  opacity: 1;
  visibility: visible;
}

.tw-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--tw-accent);
  border-radius: 50%;
  animation: tw-spin 1s linear infinite;
}

@keyframes tw-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== TOAST NOTIFICATIONS ===== */
.tw-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--tw-dark);
  color: var(--tw-white);
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
}

.tw-toast.tw-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== ANIMATIONS ===== */
@keyframes tw-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tw-fade-in-up {
  animation: tw-fadeInUp 0.6s ease-out;
}

@keyframes tw-bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

.tw-bounce {
  animation: tw-bounce 1s infinite;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.tw-btn:focus,
.tw-menu-toggle:focus,
.tw-filter-btn:focus,
.tw-bottom-nav-item:focus {
  outline: 2px solid var(--tw-accent);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .tw-header,
  .tw-bottom-nav,
  .tw-mobile-menu,
  .tw-menu-overlay {
    display: none !important;
  }

  body {
    padding: 0 !important;
  }

  .tw-content-section {
    box-shadow: none !important;
    border: 1px solid var(--tw-border) !important;
  }
}