/* Cricket Quiz App Styles */

/* Base Styles */
:root {
  --primary-color: #1e88e5;
  --primary-dark: #0d47a1;
  --primary-light: #64b5f6;
  --secondary-color: #43a047;
  --secondary-dark: #2e7d32;
  --secondary-light: #81c784;
  --warning-color: #ff9800;
  --danger-color: #e53935;
  --success-color: #43a047;
  --info-color: #00acc1;
  --gray-light: #f5f5f5;
  --gray: #9e9e9e;
  --gray-dark: #424242;
  --black: #212121;
  --white: #ffffff;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --border-radius: 8px;
}

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

/* Filter Toggle Styles */
.filter-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-section label {
    color: #555;
    font-size: 0.85rem;
}

.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.match-filter-toggle {
    transition: all 0.3s ease;
}

.match-filter-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--black);
  background-color: var(--gray-light);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header & Navigation */
.header {
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.navbar-brand img {
  margin-right: 10px;
  width: 40px;
  height: 40px;
}

.navbar-nav {
  display: flex;
  list-style: none;
}

.nav-item {
  margin-left: 20px;
}

.nav-link {
  color: var(--gray-dark);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--primary-light);
  color: var(--white);
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.user-menu-toggle img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  min-width: 200px;
  padding: 10px 0;
  display: none;
  z-index: 10;
}

.user-menu-dropdown.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 8px 20px;
  color: var(--gray-dark);
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--gray-light);
  color: var(--primary-color);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--gray-light);
  margin: 5px 0;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--primary-color);
  transition: var(--transition);
}

/* Welcome Screen / Home Page */
.hero {
  background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
  color: var(--white);
  padding: 100px 0;
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.cricket-animation {
  position: relative;
  height: 200px;
  margin: 30px 0;
}

.cricket-ball {
  position: absolute;
  width: 40px;
  height: 40px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, -70%);
  }
}

.features {
  padding: 80px 0;
  background-color: var(--white);
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.2rem;
  color: var(--primary-dark);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature-card {
  background-color: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.feature-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--gray-dark);
}

.feature-description {
  color: var(--gray);
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
}

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

.btn-secondary:hover {
  background-color: var(--secondary-dark);
}

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

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

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

.btn-danger:hover {
  background-color: #c62828;
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--gray);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.form-check-input {
  margin-right: 10px;
}

/* Auth Pages */
.auth-container {
  max-width: 500px;
  margin: 80px auto;
  padding: 30px;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.auth-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-dark);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  color: var(--gray);
}

/* Dashboard */
.dashboard {
  padding: 40px 0;
}

.dashboard-header {
  margin-bottom: 30px;
}

.dashboard-title {
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.dashboard-subtitle {
  color: var(--gray);
}

.card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  overflow: hidden;
}

.card-header {
  padding: 20px;
  background-color: var(--primary-color);
  color: var(--white);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 15px 20px;
  background-color: var(--gray-light);
  border-top: 1px solid #e0e0e0;
}

.match-card {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--gray-light);
  transition: var(--transition);
}

.match-card:hover {
  background-color: var(--gray-light);
}

.match-info {
  flex: 1;
}

.match-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.match-teams {
  color: var(--gray-dark);
  margin-bottom: 5px;
}

.match-date {
  color: var(--gray);
  font-size: 0.9rem;
}

.match-status {
  margin-left: 20px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-live {
  background-color: var(--danger-color);
  color: var(--white);
}

.status-upcoming {
  background-color: var(--warning-color);
  color: var(--white);
}

.status-completed {
  background-color: var(--gray);
  color: var(--white);
}

/* Quiz Page */
.quiz-container {
  max-width: 800px;
  margin: 40px auto;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.quiz-header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-title {
  font-size: 1.5rem;
  font-weight: 500;
}

.quiz-timer {
  font-size: 1.8rem;
  font-weight: 700;
  padding: 10px 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
}

.question-container {
  padding: 30px;
}

.question-number {
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 10px;
}

.question-text {
  font-size: 1.3rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.options-list {
  list-style: none;
}

.option-item {
  margin-bottom: 15px;
}

.option-label {
  display: block;
  padding: 15px;
  border: 1px solid var(--gray);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.option-label:hover {
  border-color: var(--primary-light);
  background-color: var(--gray-light);
}

.option-item input[type="radio"] {
  display: none;
}

.option-item input[type="radio"]:checked + .option-label {
  border-color: var(--primary-color);
  background-color: rgba(30, 136, 229, 0.1);
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  padding: 20px 30px;
  background-color: var(--gray-light);
}

/* Results Page */
.result-summary {
  text-align: center;
  padding: 40px 20px;
}

.result-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.result-text {
  color: var(--gray-dark);
  margin-bottom: 20px;
}

.result-details {
  margin-top: 30px;
}

.result-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--gray-light);
}

.result-detail-label {
  font-weight: 500;
}

.result-detail-value {
  color: var(--gray-dark);
}

.leaderboard {
  margin-top: 30px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--gray-light);
}

.leaderboard-position {
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 15px;
}

.top-position {
  background-color: var(--warning-color);
}

.leaderboard-user {
  flex: 1;
}

.leaderboard-username {
  font-weight: 500;
  margin-bottom: 5px;
}

.leaderboard-score {
  color: var(--gray);
  font-size: 0.9rem;
}

.leaderboard-result {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.winner {
  background-color: var(--success-color);
  color: var(--white);
}

/* Wallet Page */
.wallet-card {
  text-align: center;
  padding: 30px 20px;
}

.wallet-balance {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.wallet-label {
  color: var(--gray);
  margin-bottom: 20px;
}

.wallet-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.transaction-list {
  margin-top: 30px;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--gray-light);
}

.transaction-icon {
  width: 40px;
  height: 40px;
  background-color: var(--gray-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.transaction-icon.deposit {
  background-color: rgba(67, 160, 71, 0.1);
  color: var(--success-color);
}

.transaction-icon.withdrawal {
  background-color: rgba(229, 57, 53, 0.1);
  color: var(--danger-color);
}

.transaction-icon.quiz_entry {
  background-color: rgba(0, 172, 193, 0.1);
  color: var(--info-color);
}

.transaction-icon.reward {
  background-color: rgba(255, 152, 0, 0.1);
  color: var(--warning-color);
}

.transaction-info {
  flex: 1;
}

.transaction-type {
  font-weight: 500;
  margin-bottom: 5px;
}

.transaction-date {
  color: var(--gray);
  font-size: 0.8rem;
}

.transaction-amount {
  font-weight: 700;
}

.transaction-amount.positive {
  color: var(--success-color);
}

.transaction-amount.negative {
  color: var(--danger-color);
}

.transaction-status {
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: 10px;
}

.status-completed {
  background-color: rgba(67, 160, 71, 0.1);
  color: var(--success-color);
}

.status-pending {
  background-color: rgba(255, 152, 0, 0.1);
  color: var(--warning-color);
}

.status-failed {
  background-color: rgba(229, 57, 53, 0.1);
  color: var(--danger-color);
}

/* Admin Dashboard */
.admin-dashboard {
  padding: 30px 0;
}

.admin-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  margin-bottom: 30px;
  height: 100%;
}

.admin-card-title {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: var(--primary-dark);
  font-weight: 500;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.stat-label {
  color: var(--gray);
  font-size: 1rem;
}

.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--gray-light);
  text-align: left;
}

.table th {
  font-weight: 500;
  color: var(--primary-dark);
  background-color: var(--gray-light);
}

.table tr:hover {
  background-color: rgba(245, 245, 245, 0.5);
}

.table-actions {
  display: flex;
  gap: 10px;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: var(--border-radius);
  font-weight: 500;
}

.alert-success {
  background-color: rgba(67, 160, 71, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background-color: rgba(229, 57, 53, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background-color: rgba(255, 152, 0, 0.1);
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background-color: rgba(0, 172, 193, 0.1);
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--white);
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px;
  background-color: var(--primary-color);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  background-color: var(--gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .navbar-nav {
    display: none;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .navbar-nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    padding: 20px;
  }
  
  .nav-item {
    margin-left: 0;
    margin-bottom: 10px;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .wallet-actions {
    flex-direction: column;
  }
  
  .quiz-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .match-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .match-status {
    margin-left: 0;
    margin-top: 10px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in {
  animation: slideIn 0.5s ease-out;
}

/* Loading Animation */
.loading {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.loading div {
  display: inline-block;
  position: absolute;
  left: 8px;
  width: 16px;
  background: var(--primary-color);
  animation: loading 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}

.loading div:nth-child(1) {
  left: 8px;
  animation-delay: -0.24s;
}

.loading div:nth-child(2) {
  left: 32px;
  animation-delay: -0.12s;
}

.loading div:nth-child(3) {
  left: 56px;
  animation-delay: 0;
}

@keyframes loading {
  0% {
    top: 8px;
    height: 64px;
  }
  50%, 100% {
    top: 24px;
    height: 32px;
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
