/* SwimTracker Styles - Inspired by GoMotion Color Scheme */

:root {
  /* Primary Colors - Blue tones from GoMotion */
  --primary-blue: #0066cc;
  --primary-blue-dark: #004c99;
  --primary-blue-light: #3385d6;
  --accent-blue: #00a3e0;
  
  /* Secondary Colors */
  --secondary-teal: #00b8d4;
  --secondary-orange: #ff6b35;
  --secondary-green: #00c853;
  
  /* Neutral Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-light: #999999;
  --border-color: #e0e0e0;
  
  /* Navigation */
  --nav-bg: #0066cc;
  --nav-text: #ffffff;
  --nav-hover: rgba(255, 255, 255, 0.1);
  
  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-border: #e0e0e0;
  --sidebar-hover: #f0f4f8;
  --sidebar-active: #e3f2fd;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Top Navigation Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--nav-bg);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--nav-text);
}

.logo-icon {
  font-size: 32px;
  font-weight: bold;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.user-profile:hover {
  background: var(--nav-hover);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--secondary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.user-info {
  display: flex;
  flex-direction: column;
  color: var(--nav-text);
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  opacity: 0.8;
}

/* User Dropdown Menu */
.user-dropdown .dropdown-item:hover {
  background: #f5f5f5;
}

.user-dropdown .dropdown-item:active {
  background: #e0e0e0;
}

/* Left Sidebar Navigation */
.left-sidebar {
  position: fixed;
  top: 65px;
  left: 0;
  width: 260px;
  height: calc(100vh - 65px);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 900;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-links {
  list-style: none;
}

.nav-item {
  margin: 4px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 15px;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--sidebar-active);
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-icon {
  font-size: 22px;
  width: 24px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 24px;
}

.nav-section-title {
  padding: 12px 28px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.admin-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.admin-section .nav-section-title {
  color: var(--primary-blue);
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  margin-top: 65px;
  padding: 30px;
  min-height: calc(100vh - 65px);
  transition: margin-left 0.3s ease;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Page Header */
.page-header {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

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

.btn-success:hover {
  background: #00a843;
}

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

.stat-card {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
  color: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-unit {
  font-size: 14px;
  opacity: 0.8;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  background: var(--bg-primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

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

/* Tables */
.table-container {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

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

thead {
  background: var(--bg-secondary);
}

th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

td {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
}

tr:hover {
  background: var(--bg-secondary);
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
  font-size: 18px;
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 968px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .left-sidebar {
    transform: translateX(-100%);
  }
  
  .left-sidebar.active {
    transform: translateX(0);
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .user-info {
    display: none;
  }
  
  .logo-text {
    font-size: 20px;
  }
  
  .page-title {
    font-size: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main-wrapper {
    padding: 15px;
  }
  
  .card {
    padding: 16px;
  }
  
  .logo-text {
    display: none;
  }
  
  .top-nav {
    padding: 0 15px;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-30 {
  margin-bottom: 30px;
}

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

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(0, 200, 83, 0.1);
  color: var(--secondary-green);
}

.badge-primary {
  background: rgba(0, 102, 204, 0.1);
  color: var(--primary-blue);
}

.badge-warning {
  background: rgba(255, 107, 53, 0.1);
  color: var(--secondary-orange);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Team Tabs */
.team-tab {
  margin-top: 20px;
}
