/* Root & Base Styles */
html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 80px;
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Focus Styles */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Professional Navbar Styling */
.professional-navbar {
  background: linear-gradient(135deg, #FF9900 0%, #FF6B35 50%, #004E89 100%) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  padding: 0.75rem 0;
}

.professional-navbar .navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: white !important;
  letter-spacing: -0.5px;
  transition: opacity 0.3s ease;
}

.professional-navbar .navbar-brand:hover {
  opacity: 0.9;
}

.professional-navbar .navbar-logo {
  height: 45px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.professional-navbar .navbar-brand:hover .navbar-logo {
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
  margin: 0 0.5rem;
  padding: 0.5rem 0.75rem !important;
  transition: all 0.3s ease;
  border-radius: 4px;
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

.navbar-dark .navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: white;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .nav-link.active::after {
  width: calc(100% - 1.5rem);
}

/* Non-dropdown nav links always show underline */
.navbar-dark .navbar-nav .nav-link:not(.dropdown-toggle)::after {
  width: calc(100% - 1.5rem);
}

/* Dropdown Styling */
.dropdown-menu {
  border-radius: 8px;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 250px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu-dark {
  background-color: #2c3e50;
  border-color: #34495e;
}

.dropdown-menu-dark .dropdown-item {
  color: #ecf0f1;
  transition: all 0.2s ease;
  padding: 0.6rem 1rem;
}

.dropdown-menu-dark .dropdown-item:hover {
  background-color: #FF9900;
  color: white;
  padding-left: 1.2rem;
}

.dropdown-menu-dark .dropdown-item.active {
  background-color: #FF6B35;
}

.dropdown-menu-dark .dropdown-divider {
  border-color: #34495e;
}

.dropdown-menu-dark .dropdown-header {
  color: #FF9900;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.6rem 1rem 0.3rem;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar .nav-link:hover {
  color: white !important;
}

.navbar .dropdown-toggle::after {
  border-color: white;
}

.navbar .dropdown-menu {
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar .dropdown-item {
  transition: all 0.2s ease;
  padding: 0.75rem 1.5rem;
}

.navbar .dropdown-item:hover {
  background-color: #f0f0f0;
  color: #667eea;
}

/* Homepage Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 0;
  margin-bottom: 50px;
  border-radius: 0 0 15px 15px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  text-align: center;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section p {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: 0;
}

/* Feature Cards */
.feature-card {
  background: white;
  border: none;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.feature-card-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 20px;
}

.feature-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* Button Styles */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
  color: #667eea;
  border-color: #667eea;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  transform: translateY(-2px);
}

/* Quick Action Section */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.quick-action-btn {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 600;
}

.quick-action-btn:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  color: #667eea;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
  text-decoration: none;
}

/* Dashboard Grid */
.dashboard-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: #333;
  padding-bottom: 10px;
  border-bottom: 3px solid #667eea;
  display: inline-block;
}

/* Footer Enhancement */
.footer {
  background-color: #2d3748;
  color: white;
  padding: 15px 0;
  margin-top: 40px;
  position: relative;
  bottom: 0;
  width: 100%;
}

.footer a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Calendar Styles */
.calendar-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
}

.calendar-header h2 {
  margin: 0;
  color: white;
}

.calendar-header .btn-group {
  display: flex;
  gap: 5px;
}

.calendar-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.weekday {
  font-weight: 600;
  text-align: center;
  color: #667eea;
  padding: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-day {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  background: #fafafa;
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}

.calendar-day.other-month {
  opacity: 0.5;
  background: #f0f0f0;
}

.calendar-day.today {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 2px solid #667eea;
}

.day-number {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 5px;
}

.day-entries {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 5px 0;
}

.schedule-entry {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.schedule-entry.running-type {
  background: #e3f2fd;
  color: #1976d2;
  border-left: 3px solid #1976d2;
}

.schedule-entry.exercise-type {
  background: #f3e5f5;
  color: #7b1fa2;
  border-left: 3px solid #7b1fa2;
}

.entry-type {
  display: inline-block;
  background: #1976d2;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.schedule-entry.exercise-type .entry-type {
  background: #7b1fa2;
}

.entry-minutes {
  font-size: 0.75rem;
  opacity: 0.8;
}

.day-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  margin-top: auto;
}

.small-btn {
  padding: 2px 6px;
  font-size: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  color: #667eea;
  text-decoration: none;
}

.small-btn:hover {
  opacity: 1;
}

.calendar-legend {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
}

.legend-items {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-block;
}

.legend-color.running-type {
  background: #e3f2fd;
  border: 2px solid #1976d2;
}

.legend-color.exercise-type {
  background: #f3e5f5;
  border: 2px solid #7b1fa2;
}

.legend-color.today {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  border: 2px solid #667eea;
}

@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
  }

  .calendar-day {
    min-height: 80px;
    padding: 5px;
  }

  .day-number {
    font-size: 0.9rem;
  }

  .schedule-entry {
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  .entry-type {
    padding: 1px 3px;
    font-size: 0.6rem;
  }
}

/* Week Calendar Styles (Exercise Schedule) */
.week-calendar-container {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  max-width: 1000px;
  margin: 0 auto;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.week-day {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  min-height: 250px;
}

.week-day:hover {
  border-color: #667eea;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.week-day.today {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 2px solid #667eea;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.week-day.sunday {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 2px solid #667eea;
}

.day-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 6px;
  text-align: center;
}

.day-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Splash Screen / Welcome Hero */
.splash-hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FF9900 0%, #FF6B35 40%, #6B5B95 70%, #004E89 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: slideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.splash-content {
  text-align: center;
  color: white;
  max-width: 600px;
  padding: 40px 20px;
  animation: fadeInContent 0.8s ease-out 0.2s both;
}

@keyframes fadeInContent {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-logo-container {
  margin-bottom: 30px;
  perspective: 1000px;
}

.splash-logo {
  height: 120px;
  width: 120px;
  animation: bobbing 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

@keyframes bobbing {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.splash-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}

.splash-subtitle {
  font-size: 1.3rem;
  font-weight: 300;
  margin-bottom: 40px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0.95;
}

.splash-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  animation: slideUp 0s, fadeInContent 0.8s ease-out 0.4s both;
}

.splash-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  cursor: default;
}

.splash-feature:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2rem;
}

.splash-feature span:last-child {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.9;
}

.splash-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid white;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 10001;
}

.splash-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1) rotate(90deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .splash-logo {
    height: 80px;
    width: 80px;
  }

  .splash-title {
    font-size: 2rem;
  }

  .splash-subtitle {
    font-size: 1rem;
  }

  .splash-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .splash-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: 20px;
    right: 20px;
  }
}

.day-date {
  font-size: 0.8rem;
  opacity: 0.9;
}

.day-entries-container {
  flex-grow: 1;
  padding: 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.empty-day {
  color: #999;
  font-style: italic;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.schedule-entry.exercise-type {
  background: #f3e5f5;
  color: #5a2d7a;
  border-left: 3px solid #7b1fa2;
  padding: 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.entry-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-type {
  display: block;
  background: #7b1fa2;
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  width: fit-content;
}

.entry-minutes {
  font-weight: 500;
  font-size: 0.75rem;
}

.entry-notes {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-top: 2px;
  border-top: 1px solid rgba(123, 31, 162, 0.2);
  padding-top: 2px;
}

.day-actions {
  padding: 5px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
}

@media (max-width: 1200px) {
  .week-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .week-calendar-container {
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .week-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .week-day {
    min-height: 220px;
  }

  .day-header {
    padding: 8px 5px;
  }

  .day-name {
    font-size: 0.85rem;
  }

  .entry-type {
    font-size: 0.6rem;
    padding: 1px 3px;
  }
}

@media (max-width: 480px) {
  .week-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .week-day {
    min-height: 180px;
  }
}
