/* ========== Base Layout ========== */
body {
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f5f7fa;
  color: #222;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

/* ========== Branding ========== */
.logo {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  padding: 20px;
  background: #fff;
  border-bottom: 2px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  color: #2c3e50;
}

/* ========== Header & Navigation ========== */
header { background:#222; color:#fff; padding:10px 20px; }
header .logo { font-weight:bold; margin-bottom:8px; color:#fff; background:none; border:none; box-shadow:none; }

nav { position:relative; }
nav ul { list-style:none; margin:0; padding:0; display:flex; }
nav li { margin-right:15px; }
nav a { color:#ccc; text-decoration:none; padding:6px 10px; border-radius:4px; display:block; }
nav a.active, nav a:hover { background:#005fa3; color:#fff; }

/* Hamburger */
.menu-toggle { display:none; font-size:22px; background:none; border:none; color:#fff; cursor:pointer; position:relative; z-index:11; }

/* Footer styling */
.footer {
  background: linear-gradient(135deg, #0077cc, #005fa3);
  padding: 20px 10px;
  text-align: center;
  color: #fff;
  font-size: 14px;
}

.footer-links {
  margin-bottom: 8px;
  font-size: 14px;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  margin: 0 6px;
}

.footer-links a:hover,
.footer-links a:focus,
.footer-links a:active {
  color: #fff; /* stays white on all states */
  text-decoration: underline;
}

.footer-copy {
  font-size: 14px;
  opacity: 0.8;
}

/* Drawer menu */
nav ul.drawer {
  flex-direction:column;
  background:#222;
  position:fixed;
  top:0;
  left:-250px;
  width:250px;
  height:100%;
  padding:20px;
  overflow-y:auto;
  transition:left 0.3s ease-in-out;
  z-index:10;
}
nav ul.drawer.show { left:0; }

/* Overlay effect */
.menu-overlay {
  display:none;
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,0.5);
  z-index:9;
  opacity:0;
  transition:opacity 0.3s ease-in-out;
}
.menu-overlay.show { display:block; opacity:1; }

/* Responsive */
@media (max-width: 768px) {
  nav ul { display:none; }
  nav ul.drawer { display:flex; }
  .menu-toggle { display:block; }
}
@media (min-width: 769px) {
  nav ul.drawer {
    position:static;
    flex-direction:row;
    height:auto;
    width:auto;
    background:none;
    left:0;
    transition:none;
    padding:0;
  }
  nav li { margin-right:15px; }
}

/* ========== Headings ========== */
h2, h3, h4 {
  margin: 12px 0;
  font-weight: 600;
}

h2 { font-size: 22px; color: #2c3e50; }
h3 { font-size: 18px; color: #34495e; }
h4 { font-size: 16px; color: #555; }

/* ========== Messages ========== */
.message { padding: 12px; border-radius: 6px; margin: 15px 0; font-size: 14px; }
.message.info { background: #eef6ff; color: #0366d6; border: 1px solid #cce5ff; }
.message.error { background: #ffeef0; color: #d73a49; border: 1px solid #f5c6cb; }
.message.success { background: #e6ffed; color: #22863a; border: 1px solid #a5d6a7; }
.message.warning { background: #fffbea; color: #8a6d3b; border: 1px solid #f0e1a0; }

.btn-primary {
  padding: 10px;
  background: #005fa3;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.3s ease;
}
.btn-primary:hover {
  background: #0077cc;
}

.btn-secondary {
  padding: 10px;
  background: none;
  border: 1px solid #0077cc;
  color: #0077cc;
  cursor: pointer;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.3s ease;
}
.btn-secondary:hover {
  background: #0077cc;
  color: #fff;
}
/* ========== Global Table Styles ========== */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.table th, 
.table td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f2f2f2;
  font-weight: 600;
  color: #333;
}

.table tr:nth-child(even) {
  background: #fafafa;
}

.table tr:hover {
  background: #eef6ff;
}
/* ========== Transaction Row Highlights ========== */
.table tr.credit {
  background: #e6ffed; /* light green */
  color: #22863a;
}

.table tr.debit {
  background: #ffeef0; /* light red */
  color: #d73a49;
}

/* ========== Match List (Dashboard) ========== */
.match-list { margin: 20px 0; }
.match-item { background: #fff; padding: 12px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow: hidden; transition: background 0.2s ease, border 0.2s ease; }
.match-item:hover { background: #f9f9f9; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.match-item a { text-decoration: none; color: #2c3e50; font-weight: bold; display: flex; align-items: center; justify-content: space-between; }
.match-item a:hover { color: #0077cc; }
.match-item.live { border: 2px solid #007bff; }
.match-item .team-logo { width: 36px; height: 36px; object-fit: contain; margin-right: 8px; }
.match-item .status { font-size: 13px; color: #555; }
.team-logo { width: 20px; height: 20px; object-fit: contain; }

/* ========== Scorecard (Match Page) ========== */
.scorecard { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin: 20px 0; }
.team-card { flex: 1 1 220px; background: #fff; border-radius: 12px; padding: 18px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.2s, box-shadow 0.2s; }
.team-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.team-card img { width: 52px; height: 52px; object-fit: contain; margin-bottom: 10px; }
.team-card .team { font-weight: bold; margin: 6px 0; font-size: 16px; }
.team-card .score { font-size: 22px; font-weight: bold; color: #27ae60; }
.team-card .status { font-size: 14px; color: #555; }
.status { font-size: 0.8em; color: #666; display: block; margin-top: 6px; }
.team-name { font-size: 1em; font-weight: 500; }
.team-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.team-line .left { display: flex; align-items: left; gap: 6px; }

/* ========== Ball Outcome (Match Page) ========== */
.last-ball .ball { display: inline-block; padding: 6px 12px; border-radius: 6px; margin: 4px 0; font-size: 14px; }
.outcome.four { background: #e8f8f2; color: #27ae60; font-weight: bold; }
.outcome.six { background: #fff3e0; color: #e67e22; font-weight: bold; }
.outcome.wicket { background: #fdecea; color: #c0392b; font-weight: bold; }

/* ========== Ball History ========== */
.ball-history { background: #fff; padding: 12px; border-radius: 10px; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.ball-history .ball { background: #f1f1f1; padding: 6px 10px; border-radius: 6px; font-size: 13px; }

/* ========== Refresh Indicator ========== */
#refresh-indicator { font-size: 13px; color: #666; margin-top: 10px; text-align: center; }

/* ========== Navigation Links ========== */
.form-links { margin-top: 20px; text-align: center; font-size: 14px; }
.form-links a { color: #d73a49; font-weight: bold; text-decoration: none; }
.form-links a:hover { text-decoration: underline; }

/* ========== Live Status Pulse ========== */
.live-status { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: bold; color: #c0392b; }
.live-dot { width: 8px; height: 8px; margin-right: 4px; background: #e74c3c; border-radius: 50%; display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(0.9); opacity: 0.7; } 50% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(0.9); opacity: 0.7; } }

/* ========== Auth Pages ========== */
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #f5f7fa; padding: 20px; }
.auth-box { background: #fff; padding: 2rem; border-radius: 16px; box-shadow: 0 6px 18px rgba(0,0,0,0.1); max-width: 420px; width: 100%; animation: fadeIn 0.4s ease-in-out; }
.auth-box h2 { margin-bottom: 1.5rem; text-align: center; font-size: 1.8rem; font-weight: bold; color: #2c3e50; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; }
.auth-box label { font-weight: 600; font-size: 14px; color: #444; }
.auth-box input, .auth-box select { padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; transition: border-color 0.2s, box-shadow 0.2s; }
.auth-box input:focus, .auth-box select:focus { border-color: #0077cc; box-shadow: 0 0 0 3px rgba(0,119,204,0.2); outline: none; }
.auth-box button { padding: 12px; font-size: 16px; font-weight: bold; border: none; border-radius: 10px; cursor: pointer; background: linear-gradient(135deg, #0077cc, #005fa3); color: white; transition: transform 0.2s, box-shadow 0.2s; }
.auth-box button:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,0.15); }

/* Password toggle */
.password-field, .password-wrapper { position: relative; }
.password-field input, .password-wrapper input { width: 100%; }
.password-field .toggle-password, .password-wrapper .toggle-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; font-size: 16px; }

/* Legal note */
.legal-note { margin-top: 20px; padding: 12px; background: #fffbea; border: 1px solid #f0e1a0; border-radius: 6px; font-size: 14px; color: #444; line-height: 1.4; }
.legal-note strong { display: block; margin-bottom: 6px; color: #222; }
.footer-line { margin-top: 12px; text-align: center; font-size: 12px; color: #777; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); justify-content: center; align-items: center; z-index: 1000; opacity: 0; transition: opacity 0.28s ease; }
.modal-content { background: #fff; padding: 20px; border-radius: 8px; max-width: 400px; text-align: center; box-shadow: 0 4px 8px rgba(0,0,0,0.2); position: relative; transform: scale(0.96); transition: transform 0.28s ease;}
.close-btn { cursor: pointer; color: #333; font-size: 18px; position: absolute; right: 10px; top: 10px; }
.modal.show { display: flex;  opacity: 1;}
.modal.show .modal-content { transform: scale(1); }

/* ========== Mobile Responsiveness ========== */
@media (max-width: 600px) {
  .match-item a { flex-direction: column; text-align: center; }
  .scorecard { flex-direction: column; }
}

/* ========== Dark Mode ========== */
body.dark-mode { background: #1c1c1c; color: #eee; }
body.dark-mode .logo { color: #f5f5f5; }
body.dark-mode .match-item, body.dark-mode .team-card, body.dark-mode .ball-history, body.dark-mode .auth-box { background: #2b2b2b; color: #eee; box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
body.dark-mode .match-item a { color: #f5f5f5; }
body.dark-mode .match-item a:hover { color: #66b2ff; }
body.dark-mode .team-card .score { color: #2ecc71; }
body.dark-mode .message.info { background: #1f2937; color: #60a5fa; border: 1px solid #374151; }
body.dark-mode .message.error { background: #3b0d0c; color: #fca5a5; border: 1px solid #ef4444; }
body.dark-mode .ball-history .ball { background: #3b3b3b; color: #ddd; }
body.dark-mode .form-links a { color: #ff7675; }
body.dark-mode #theme-toggle { background: linear-gradient(135deg, #2c2c2c, #3a3a3a); color: #eee; box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
body.dark-mode #theme-toggle:hover { background: linear-gradient(135deg, #383838, #444); box-shadow: 0 4px 12px rgba(0,0,0,0.8); }

/* ========== Dark Mode Toggle Button ========== */
#theme-toggle { padding: 8px 14px; border: none; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; background: linear-gradient(135deg, #f1f1f1, #e2e2e2); color: #333; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: all 0.25s ease; }
#theme-toggle:hover { background: linear-gradient(135deg, #eaeaea, #dcdcdc); box-shadow: 0 4px 10px rgba(0,0,0,0.25); transform: translateY(-1px); }
#theme-toggle:active { transform: scale(0.96); }

/* ========== Header & Navigation with Right Drawer, Responsive Logo Fix ========== */
header {
  background:linear-gradient(135deg, #0077cc, #005fa3);
  color:#fff;
  padding:10px 20px;
  position:relative;
  z-index:20;
}
.header-bar {
  display:flex;
  align-items:center;
  justify-content:space-between;
}
header .logo {
  font-weight:bold;
  color:#fff;
  font-size:24px;
}

/* Adjust logo for mobile */
@media (max-width: 768px) {
  header .logo {
    font-size:18px;
    margin-right:10px;
  }
}

nav { position:relative; }
nav ul {
  list-style:none;
  margin:0;
  padding:0;
}
nav li { margin:10px 0; }
nav a {
  color:#fff;
  text-decoration:none;
  padding:8px 12px;
  border-radius:4px;
  display:block;
  opacity:0;
  transform:translateX(20px);
  transition:opacity 0.3s ease, transform 0.3s ease;
}
nav a.active, nav a:hover {
  background:#005fa3;
  color:#e1e1e1;
}

/* Hamburger */
.menu-toggle {
  font-size:22px;
  background:none;
  border:none;
  color:#fff;
  cursor:pointer;
  z-index:21;
}

/* Drawer menu (slide from right, hidden fully off-screen) */
nav ul.drawer {
  display:flex;
  flex-direction:column;
  background:linear-gradient(135deg, #0077cc, #005fa3);
  position:fixed;
  top:0;
  right:-100%; /* fully off-screen, fixes peek */
  width:250px;
  height:100%;
  padding:20px;
  overflow-y:auto;
  transition:right 0.3s ease-in-out;
  z-index:20;
  box-sizing:border-box;
}
nav ul.drawer.show {
  right:0;
}
nav ul.drawer.show a {
  opacity:1;
  transform:translateX(0);
}
nav ul.drawer.show li:nth-child(1) a { transition-delay:0.05s; }
nav ul.drawer.show li:nth-child(2) a { transition-delay:0.1s; }
nav ul.drawer.show li:nth-child(3) a { transition-delay:0.15s; }
nav ul.drawer.show li:nth-child(4) a { transition-delay:0.2s; }
nav ul.drawer.show li:nth-child(5) a { transition-delay:0.25s; }
nav ul.drawer.show li:nth-child(6) a { transition-delay:0.3s; }
nav ul.drawer.show li:nth-child(7) a { transition-delay:0.35s; }
nav ul.drawer.show li:nth-child(8) a { transition-delay:0.4s; }
nav ul.drawer.show li:nth-child(9) a { transition-delay:0.45s; }

/* Overlay effect with blur */
.menu-overlay {
  display:none;
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index:19;
  opacity:0;
  transition:opacity 0.3s ease;
}
.menu-overlay.show {
  display:block;
  opacity:1;
}

/* Responsive */
@media (max-width: 768px) {
  nav ul:not(.drawer) { display:none; }
  .menu-toggle { display:block; }
  header .logo { text-align:left; }
}
@media (min-width: 769px) {
  .menu-toggle { display:none; }
  nav ul.drawer {
    position:static;
    flex-direction:row;
    height:auto;
    width:auto;
    background:none;
    right:0;
    transition:none;
    padding:0;
  }
  nav li { margin:0 10px; }
  nav a { opacity:1; transform:none; transition:none; }
  header .logo { text-align:center; width:100%; }
}

/* FAQ Accordion Styles with + / - toggle */
.faq-item {
  margin-bottom: 12px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: #f5f5f5;
  border: none;
  outline: none;
  padding: 12px 36px 12px 12px; /* extra right padding for icon */
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  border-radius: 6px;
  position: relative;
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.3s;
}

.faq-question.active::after {
  content: "–";
}

.faq-question:hover,
.faq-question.active {
  background: #e0e0e0;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fff;
  padding: 0 12px;
  border-left: 3px solid #ccc;
  margin-top: 6px;
  border-radius: 0 0 6px 6px;
}

.faq-answer p {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* ========== Admin Credit Page ========== */
.admin-container {
  max-width: 960px;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
}

.admin-container h2, 
.admin-container h3 {
  margin-top: 0;
  color: #2c3e50;
}

.admin-form {
  margin-bottom: 20px;
  position: relative;
  max-width: 600px;
}

.admin-form label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
  color: #34495e;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.admin-form textarea {
  min-height: 60px;
  resize: vertical;
}

/* Suggestions dropdown */
#suggestions {
  border: 1px solid #005fa3;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  z-index: 1000;
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#suggestions div {
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

#suggestions div:hover {
  background: #0077cc;
  color: #fff;
}

#suggestions div:last-child {
  border-bottom: none;
}

/* Base Snackbar */
.snackbar {
  visibility: hidden;
  min-width: 220px;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 12px;
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.4s, bottom 0.4s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.snackbar.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px; /* lift slightly */
}

/* Variants */
.snackbar-success { background-color: #28a745; } /* green */
.snackbar-error   { background-color: #dc3545; } /* red */
.snackbar-info    { background-color: #007bff; } /* blue */

.score { font-size: 0.9em; color: #444; font-weight: 500; }
.score.chasing { color: orange; } /* orange for chasing */
.score.winner { color: green; font-weight: 600; }
.score.loser { color: red; font-weight: 600; }
.match-live { border: 2px solid #007bff; padding: 8px; border-radius: 6px; }


.announcement-bar {
  background: #fffae6;
  color: #333;
  text-align: center;
  padding: 10px 40px;
  font-size: 15px;
  position: relative;
  border-bottom: 1px solid #ddd;
}

.announcement-bar span {
  font-weight: 500;
}

.announcement-close {
  position: absolute;
  right: 15px;
  top: 8px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

.announcement-close:hover {
  color: #000;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-container {
    margin: 20px;
    padding: 15px;
  }
  .admin-form {
    max-width: 100%;
  }
  .btn-primary {
    font-size: 14px;
    padding: 8px;
  }
}
    .positive { color: green; }
    .negative { color: red; }
    
    .highlight-india {
      border: 1px solid #1e90ff;
      border-radius: 12px;
      padding: 8px;
      background: #f0f8ff;
    }
    .highlight-ipl {
      border: 1px solid #ff4500;
      border-radius: 12px;
      padding: 8px;
      background: #fff5f0;
    }