/* 
 * Bwinners.net Cashbox - Vanilla Implementation
 * Replicating the React/Tailwind styling in vanilla CSS
 */

/* CSS Variables for Theme Colors */
:root {
  --primary: #121212;
  --secondary: #32404d;
  --btn-primary: #02519c;
  --accent-primary: #79bff2;
  --game-btn: #1b72b1;
  --game-btn-selected: rgba(27, 114, 177, 0.31);
  --text-white: #ffffff;
  --text-gray-300: #d1d5db;
  --text-gray-400: #9ca3af;
  --text-gray-500: #6b7280;
  --text-red-500: #ef4444;
  --text-green-400: #4ade80;
  --border-gray-300: #d1d5db;
  --bg-slate-50: #f8fafc;
  --bg-slate-900: #0f172a;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--primary);
  color: var(--text-white);
  overflow-x: hidden;
}

/* Page Management */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: flex;
}

/* Landing Page Styles */
.landing-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: center;
  align-items: center;
  background-color: var(--secondary);
  width: 100%;
  overflow-x: hidden;
}

.landing-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 1rem 1.5rem;
  background-color: #023c69;
  min-height: 400px;
  margin: 0 auto;
}

.logo-container {
  width: 100%;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.logo {
  object-fit: contain;
  width: 100%;
  max-width: 400px;
  height: auto;
  min-height: 60px;
  max-height: 100px;
}

.logo-fallback {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-white);
  display: none;
}

.logo[style*="display: none"] + .logo-fallback {
  display: block;
}

.text-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 1rem;
}

.welcome-title {
  color: var(--text-white);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  font-size: 1.25rem;
  word-wrap: break-word;
}

.status-text {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.4;
}

.status-text.error {
  color: var(--text-red-500);
}

.instruction-text {
  color: var(--text-white);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.button-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem;
  max-width: 24rem;
}

/* Button Styles */
.btn {
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1.5rem;
  height: 51px;
  transition: all 0.2s ease;
  min-width: 120px;
}

.btn-primary {
  background-color: var(--btn-primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background-color: #0369a1;
}

.btn-primary:disabled {
  background-color: var(--text-gray-500);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--text-gray-500);
  color: var(--text-white);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--btn-primary);
  color: var(--btn-primary);
}

.btn-danger {
  background-color: var(--text-red-500);
  color: var(--text-white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  height: 44px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  height: 56px;
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

/* Sign In Page Styles */
.signin-container {
  display: flex;
  background-color: var(--primary);
  height: 100vh;
  justify-content: center;
  align-items: center;
}

.signin-content {
  display: flex;
  padding: 1.5rem 3rem;
  width: 900px;
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  padding-bottom: 50px;
}

.signin-form-container {
  max-width: 690px;
  background-color: var(--secondary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--text-white);
  border-radius: 0.75rem;
  width: 100%;
  padding: 2rem;
}

.signin-title {
  font-size: 1.875rem;
  padding-bottom: 1rem;
  color: var(--text-white);
  font-weight: 600;
  text-align: center;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.input-field {
  background-color: var(--bg-slate-50);
  border: 1px solid var(--border-gray-300);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  width: 100%;
  height: 48px;
  transition: border-color 0.2s ease;
  color: #1f2937;
}

.input-field:focus {
  outline: none;
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px rgba(2, 81, 156, 0.1);
}

.input-field.error {
  border-color: var(--text-red-500);
}

.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-gray-500);
  z-index: 1;
}

.error-message {
  color: var(--text-red-500);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  min-height: 1.2rem;
}

.input-help {
  font-size: 0.75rem;
  color: var(--text-gray-300);
  margin-top: 0.25rem;
}

/* Loading Spinner */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--text-white);
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

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

.btn .loading-spinner {
  margin-right: 8px;
}

/* Overview Page Styles */
.navbar {
  background-color: var(--secondary);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
}

.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background-color: var(--primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-gray-400);
  font-size: 1rem;
  cursor: pointer;
  padding: 1rem 2rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-white);
}

.tab-btn.active {
  color: var(--text-white);
  border-bottom-color: var(--btn-primary);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  height: calc(100vh - 140px);
}

/* Loading, Error, No Data States */
.loading-container,
.error-container,
.no-data-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.loading-text,
.error-title,
.no-data-title {
  font-size: 1.125rem;
  color: var(--text-white);
  margin-top: 1rem;
}

.error-description,
.no-data-description {
  font-size: 0.875rem;
  color: var(--text-gray-400);
  margin-top: 0.5rem;
}

.error-title {
  color: #fca5a5;
}

/* Games Table */
.games-table-container {
  height: 100%;
}

.table-wrapper {
  overflow-x: auto;
  background-color: var(--secondary);
  border-radius: 0.5rem;
}

.games-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--secondary);
}

.games-table th,
.games-table td {
  padding: 0.75rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.games-table th {
  background-color: var(--primary);
  color: var(--text-white);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.games-table td {
  color: var(--text-white);
  font-size: 0.875rem;
}

.col-id {
  width: 60px;
}
.col-time {
  width: 96px;
}
.col-info {
  width: 80px;
}
.col-league {
  width: 112px;
}
.col-game {
  width: 176px;
}
.col-odds {
  width: 64px;
}
.col-more {
  width: 64px;
}

/* Game Button Styles */
.game-btn {
  background-color: var(--game-btn);
  border: none;
  border-radius: 0.25rem;
  color: var(--text-white);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem;
  min-width: 48px;
  height: 44px;
  font-size: 0.875rem;
}

.game-btn:hover {
  background-color: #1e6bb8;
}

.game-btn.selected {
  background-color: var(--game-btn-selected);
  border: 2px solid var(--accent-primary);
}

.game-btn:disabled {
  background-color: var(--text-gray-500);
  cursor: not-allowed;
}

/* Betting Slip */
.betting-slip {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  background-color: var(--secondary);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.betting-slip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.betting-slip-header h3 {
  color: var(--text-white);
  font-size: 1.125rem;
  font-weight: 600;
}

.clear-btn {
  background: none;
  border: 1px solid var(--text-red-500);
  color: var(--text-red-500);
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.betting-slip-content {
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.betting-slip-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.total-odds,
.potential-winnings {
  display: flex;
  justify-content: space-between;
  color: var(--text-white);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: var(--secondary);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  padding: 1rem;
  min-width: 300px;
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid var(--text-green-400);
}

.toast.error {
  border-left: 4px solid var(--text-red-500);
}

.toast.warning {
  border-left: 4px solid #fbbf24;
}

.toast-content {
  color: var(--text-white);
}

.toast-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.toast-icon {
  font-size: 1.125rem;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.toast-description {
  font-size: 0.875rem;
  color: var(--text-gray-300);
}

/* Responsive Design */
@media (max-width: 768px) {
  .signin-content {
    padding: 1rem;
    width: 100%;
  }

  .signin-form-container {
    padding: 1.5rem;
  }

  .navbar-content {
    padding: 0;
  }

  .navbar-title {
    font-size: 1.25rem;
  }

  .tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .main-content {
    padding: 0.5rem;
  }

  .games-table {
    font-size: 0.75rem;
  }

  .games-table th,
  .games-table td {
    padding: 0.5rem 0.25rem;
  }

  .betting-slip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: none;
    width: 100%;
    border-radius: 0;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
  }
}

@media (max-width: 480px) {
  .welcome-title {
    font-size: 1.125rem;
  }

  .signin-title {
    font-size: 1.5rem;
  }

  .navbar-title {
    font-size: 1rem;
  }

  .table-wrapper {
    border-radius: 0;
  }
}
