/* Modern.css - Sophisticated UI for Sportacus */

/* ---------- VARIABLES ---------- */
:root {
  /* Main colors */
  --primary-color: #4361ee;
  --primary-color-rgb: 67, 97, 238;
  --primary-hover: #3a56d4;
  --secondary-color: #48bfe3;
  --success-color: #06d6a0;
  --info-color: #118ab2;
  --warning-color: #f9c74f;
  --danger-color: #ef476f;
  
  /* Neutral colors */
  --dark: #2b2d42;
  --gray-dark: #495057;
  --gray: #6c757d;
  --gray-light: #ced4da;
  --light: #f8f9fa;
  
  /* Light mode */
  --body-bg: #f7f9fc;
  --card-bg: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --sidebar-bg: #ffffff;
  --sidebar-item-hover: #f3f6ff;
  --sidebar-active-bg: #eef2ff;
  --navbar-bg: #118ab2;
  --text-color: #343a40;
  --text-muted: #6c757d;
  
  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 70px;
  --navbar-height: 64px;
  --border-radius: 8px;
  --card-border-radius: 12px;
  --button-border-radius: 8px;
  --input-border-radius: 8px;
  --transition-speed: 0.3s;
  --logo-size-desktop: 90px;
  --logo-size-mobile: 50px;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
  --body-bg: #121212;
  --card-bg: #1e1e1e;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --sidebar-bg: #1e1e1e;
  --sidebar-item-hover: #2c2c2c;
  --sidebar-active-bg: #2d3748;
  --navbar-bg: #1e1e1e;
  --text-color: #e1e1e1;
  --text-muted: #a0aec0;
}

/* ---------- GLOBAL ---------- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-color);
  line-height: 1.5;
  font-size: 0.95rem;
  overflow-x: hidden;
  transition: background-color var(--transition-speed);
}

.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.text-muted {
  color: var(--text-muted) !important;
}

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

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

/* ---------- NAVBAR ---------- */
.navbar {
  background-color: var(--navbar-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  height: var(--navbar-height);
  box-shadow: 0 2px 10px var(--shadow-color);
  z-index: 1030;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  opacity: 0.9;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--logo-size-desktop);
  height: var(--logo-size-desktop);
  background-color: transparent;
  border-radius: 10px;
  padding: 0;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease;
}

.brand-text {
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  margin-left: 15px;
  font-size: 1.6rem;
}

.navbar-brand img {
  transition: transform 0.3s ease;
}

.nav-link {
  color: var(--gray-dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-color);
  background-color: var(--sidebar-item-hover);
}

.nav-link.active {
  color: var(--primary-color);
  background-color: var(--sidebar-active-bg);
}

.nav-icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

/* Navbar search */
.navbar .input-group-text,
.navbar .form-control {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.navbar .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.navbar .form-control:focus {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
}

.navbar .input-group-text {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- BUTTONS ---------- */
.btn {
  font-weight: 500;
  padding: 0.475rem 1.25rem;
  border-radius: var(--button-border-radius);
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar .btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: transparent;
  color: white;
  border: none;
  transition: background-color 0.2s ease;
}

.navbar .btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--sidebar-item-hover);
  color: var(--text-color);
  border: none;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

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

/* ---------- CONTENT WRAPPER ---------- */
.content-wrapper {
  display: flex;
  flex-grow: 1;
  margin-top: var(--navbar-height);
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  z-index: 1025;
  overflow-y: auto;
  transition: transform var(--transition-speed), width var(--transition-speed);
  display: flex;
  flex-direction: column;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-link span {
  display: none;
}

.sidebar-collapsed .sidebar-icon {
  margin-right: 0;
}

.sidebar-content {
  flex: 1;
  padding: 1.5rem 0;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 0 1.5rem;
  margin-bottom: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--primary-color);
  background-color: var(--sidebar-item-hover);
  border-left-color: var(--primary-color);
}

.sidebar-link.active {
  color: var(--primary-color);
  background-color: var(--sidebar-active-bg);
  border-left-color: var(--primary-color);
}

.sidebar-icon {
  font-size: 1.1rem;
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
  transition: margin-right var(--transition-speed);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.api-status-indicator {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background-color: var(--gray);
}

.status-dot.online {
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px rgba(6, 214, 160, 0.2);
}

.status-dot.offline {
  background-color: var(--danger-color);
  box-shadow: 0 0 0 2px rgba(239, 71, 111, 0.2);
}

#sidebarOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1024;
  display: none;
}

#mobileSidebar {
  transform: translateX(-100%);
  width: 280px;
}

.sidebar-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1030;
  border: none;
  transition: background-color 0.2s ease;
}

.sidebar-toggle i {
  font-size: 1.5rem;
}

.sidebar-toggle:hover {
  background-color: var(--primary-hover);
}

@media (max-width: 991.98px) {
  #mobileSidebar {
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  }
  
  .sidebar-toggle {
    width: 48px;
    height: 48px;
  }
  
  .sidebar-toggle i {
    font-size: 1.25rem;
  }
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
  padding: 1.5rem;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed);
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* No sidebar layout (for landing page) */
.main-content.no-sidebar {
  margin-left: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;
}

/* Landing page specific styling */
.landing-page .content-wrapper {
  display: block;
  margin-top: var(--navbar-height);
  width: 100%;
}

.landing-page .main-content {
  padding: 0;
  margin-left: 0;
}

.landing-page .container {
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 991.98px) {
  .main-content {
    margin-left: 0;
    padding: 1.25rem 1rem;
  }
  
  .mobile-sidebar-active #mobileSidebar {
    transform: translateX(0);
  }
  
  .mobile-sidebar-active #sidebarOverlay {
    display: block;
  }
  
  h1, .h1 {
    font-size: 1.75rem;
  }
  
  h2, .h2 {
    font-size: 1.5rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .btn {
    font-size: 0.9rem;
  }
}

@media (max-width: 575.98px) {
  .main-content {
    padding: 1rem 0.75rem;
  }
  
  h1, .h1 {
    font-size: 1.5rem;
  }
  
  h2, .h2 {
    font-size: 1.25rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .navbar {
    padding: 0.5rem 0.75rem;
  }
  
  .container, .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  table {
    font-size: 0.85rem;
  }
}

/* ---------- CARDS ---------- */
.card {
  border-radius: var(--card-border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  box-shadow: 0 4px 15px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.card-title {
  margin-bottom: 0;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* ---------- UTILITY CLASSES ---------- */
.avatar {
  font-weight: 600;
}

/* Animations */
.zoom-effect {
  transition: transform 0.2s ease;
}

.zoom-effect:hover {
  transform: scale(1.02);
}

/* ---------- FOOTER ---------- */
.footer {
  background-color: var(--sidebar-bg);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0 1rem;
  color: var(--text-muted);
}

.footer-link {
  color: var(--text-muted);
  display: block;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.footer-copyright {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

/* ---------- RESPONSIVE ADJUSTMENTS ---------- */
@media (max-width: 991.98px) {
  :root {
    --navbar-height: 60px;
  }
  
  .navbar-brand span {
    font-size: 1.1rem;
  }
  
  .logo-wrapper {
    width: var(--logo-size-mobile);
    height: var(--logo-size-mobile);
    padding: 2px;
  }
  
  .brand-text {
    font-size: 1.2rem;
    margin-left: 8px;
  }
  
  .navbar .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }
  
  .btn-icon {
    width: 34px;
    height: 34px;
  }
  
  .footer {
    padding: 1.5rem 0 1rem;
  }
}

@media (max-width: 575.98px) {
  .logo-wrapper {
    width: 45px;
    height: 45px;
  }
  
  .navbar-brand {
    margin-right: 0.5rem;
  }
  
  .navbar .container-fluid {
    padding-left: 5px;
    padding-right: 5px;
  }
  
  .navbar .btn-icon {
    width: 32px;
    height: 32px;
  }
  
  .btn {
    padding: 0.375rem 1rem;
  }
  
  .dropdown-menu {
    min-width: 260px;
  }
}

/* ---------- DASHBOARD STATS ---------- */
.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.15;
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: var(--primary-color);
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-card .stat-change {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.stat-card .stat-change-positive {
  color: var(--success-color);
}

.stat-card .stat-change-negative {
  color: var(--danger-color);
}

.progress-thin {
  height: 4px;
  border-radius: 2px;
  margin-top: 0.5rem;
}

/* Loading effects */
.shimmer {
  background: linear-gradient(90deg, var(--card-bg) 0%, var(--light) 50%, var(--card-bg) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.form-control {
  height: calc(2.5rem);
  border-radius: var(--input-border-radius);
  border-color: var(--border-color);
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.input-group-text {
  border-radius: var(--input-border-radius);
  border-color: var(--border-color);
}

/* ---------- FORM PAGES (LOGIN/REGISTER) ---------- */
@media (max-width: 575.98px) {
  .main-content .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* Ensure login form inputs have proper spacing and sizing on mobile */
.input-group .input-group-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
}

/* Specific styling for auth cards (login/register) */
.main-content .card {
  margin-top: 1.5rem;
}

@media (max-width: 575.98px) {
  .input-group .input-group-text {
    width: 38px;
  }
  
  .input-group .form-control {
    height: 42px;
  }
  
  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
  
  /* Extra margin for auth forms on mobile */
  .main-content .card {
    margin-top: 0.5rem;
  }
}

/* ---------- LOGIN FORM FIXES ---------- */
/* Fix for login button text breaking */
.btn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fix for brand name in login page */
.brand-text, 
.card-header h4, 
.login-title {
  white-space: nowrap;
}

/* Fix for logo in login form */
.login-logo {
  white-space: nowrap;
  text-align: center;
}

/* Specific fix for the login button in the blue box */
.login-button {
  white-space: nowrap !important;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 0.75rem;
  font-weight: 500;
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
}

.login-button i {
  display: inline-block;
  font-size: 1.15rem;
}

/* Login form specific styling */
.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Input groups for login and forms */
.input-group {
  transition: all 0.2s ease-in-out;
}

.input-group:focus-within {
  box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.15);
}

.input-group-text {
  transition: all 0.2s ease-in-out;
}

.input-group:focus-within .input-group-text {
  border-color: var(--primary-color);
  box-shadow: none;
}

/* Login card specific styling */
.card-header.bg-primary {
  background-color: var(--primary-color) !important;
  color: white;
  border-bottom: none;
}

/* Remember me checkbox styling */
.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.15);
}

/* Fix overlapping elements in mobile view */
@media (max-width: 575.98px) {
  .card-body {
    padding: 1rem;
  }
  
  .input-group .form-control, 
  .input-group .input-group-text {
    font-size: 0.9rem;
  }
  
  .btn {
    font-size: 0.95rem;
    padding: 0.375rem 0.75rem;
  }
}