
/* bsc_lottery_game/frontend/css/style.css */
:root {
  --primary-color: #8B5CF6;
  --primary-dark: #7C3AED;
  --secondary-color: #EC4899;
  --accent-color: #F59E0B;
  --bg-dark: #0F172A;
  --bg-medium: #1E293B;
  --text-light: #F8FAFC;
  --text-muted: #94A3B8;
  --border-color: rgba(139, 92, 246, 0.5);
}

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

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Particles background */
#particles-js {
  pointer-events: none;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(45deg, var(--accent-color), var(--secondary-color), var(--primary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% 300%;
  animation: textGradient 4s ease infinite;
}

@keyframes textGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Common card styles */
.lottery-card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lottery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Lottery header */
.lottery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-timer {
  background: rgba(15, 23, 42, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

/* Lottery information */
.lottery-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.info-item .value {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Lottery purchase */
.lottery-purchase {
  margin-bottom: 2rem;
}

.purchase-input {
  display: flex;
  align-items: center;
  margin: 1rem 0;
}

.ticket-input {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem 0 0 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  width: 100px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}

.ticket-input:focus {
  border-color: var(--primary-color);
}

.input-label {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-light);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
}

.buy-btn {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 1rem;
  transition: transform 0.2s, opacity 0.2s;
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.buy-btn:active {
  transform: translateY(0);
}

.buy-btn:disabled {
  background: linear-gradient(45deg, #4B5563, #6B7280);
  cursor: not-allowed;
  opacity: 0.6;
}

.ticket-cost-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* My tickets */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.ticket {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.ticket:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.ticket-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Latest result display */
.result-display {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}

.result-period {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 1rem 0;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.result-winner, .result-amount {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* Stats display */
.stats-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  align-items: center;
}

.stat-item i {
  font-size: 1.5rem;
  margin-right: 1rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* History table */
.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
}

.history-table th,
.history-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
}

.history-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
  font-weight: 500;
  position: sticky;
  top: 0;
}

.history-table th:first-child {
  border-top-left-radius: 0.5rem;
}

.history-table th:last-child {
  border-top-right-radius: 0.5rem;
}

.history-table tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.4);
}

.history-table tr:hover {
  background: rgba(15, 23, 42, 0.6);
}

/* Admin panel */
.admin-controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-input {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
}

.admin-btn {
  background: #3B82F6;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* Modal */
.modal-backdrop {
  animation: fadeIn 0.3s ease;
}

.modal-content {
  animation: slideIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

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

/* Connect wallet button */
.connect-btn {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.pulse-effect {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(139, 92, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .lottery-header, .control-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .countdown-timer {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }
  
  .purchase-input {
    flex-wrap: wrap;
  }
  
  .buy-btn {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
  }
  
  .lottery-info {
    grid-template-columns: 1fr;
  }
  
  .ticket-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .history-table {
    font-size: 0.75rem;
  }
}

/* Animations for tickets */
@keyframes newTicket {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.new-ticket {
  animation: newTicket 0.5s ease;
}

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

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