/* Button Styles */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  background: none;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #1e7e34;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 18px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  color: #495057;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Schedule Cards */
.schedules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.schedule-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.schedule-card h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.schedule-meta {
  margin-bottom: 15px;
}

.schedule-meta p {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 5px;
}

.schedule-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Stage Creation Form */
.stages-section {
  margin: 30px 0;
}

.stage-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid #007bff;
}

.stage-item .form-group {
  margin-bottom: 15px;
}

.remove-stage {
  margin-top: 10px;
}

/* Stopwatch Components */
.stopwatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 30px 0;
}

.global-stopwatch, .local-stopwatch {
  background: white;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.global-stopwatch {
  border-left: 4px solid #dc3545;
}

.local-stopwatch {
  border-left: 4px solid #28a745;
}

.stopwatch-display {
  font-size: 3rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  margin: 20px 0;
  color: #2c3e50;
}

.stopwatch-controls {
  margin-top: 20px;
}

.stopwatch-controls .btn {
  margin: 0 10px;
}

.current-stage-name {
  font-size: 1.2rem;
  color: #28a745;
  font-weight: 500;
  margin-top: 15px;
}

/* Session Content Components */
.session-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-top: 30px;
}

.current-stage-section {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stage-stats {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-item .label {
  font-weight: 500;
  color: #495057;
}

.stat-item .value {
  font-weight: 600;
  color: #2c3e50;
}

.no-stats {
  color: #6c757d;
  font-style: italic;
  text-align: center;
}

.stages-overview {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stages List */
.stages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stages-list .stage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #e9ecef;
  margin-bottom: 0;
}

.stages-list .stage-item.completed {
  border-left-color: #28a745;
  background: #d4edda;
}

.stages-list .stage-item.current {
  border-left-color: #ffc107;
  background: #fff3cd;
}

.stage-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stage-info strong {
  color: #2c3e50;
}

.stage-stats {
  display: flex;
  gap: 15px;
  font-size: 0.9em;
  color: #6c757d;
}

.stage-stats .stat {
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 4px;
}

.completion-time {
  font-weight: bold;
  color: #28a745;
}

.in-progress {
  color: #ffc107;
  font-weight: 500;
}

.pending {
  color: #6c757d;
  font-weight: 500;
}

/* Performance Table */
.performance-table-container {
  overflow-x: auto;
  margin: 20px 0;
}

.performance-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.performance-table th,
.performance-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.performance-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.performance-table tr:last-child td {
  border-bottom: none;
}

.performance-table tr.best {
  background: #d4edda;
}

.performance-table tr.above-average {
  background: #d1ecf1;
}

.performance-table tr.below-average {
  background: #fff3cd;
}

.performance-table tr.worst {
  background: #f8d7da;
}

/* Badge Styles */
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 500;
}

.badge.best {
  background: #28a745;
  color: white;
}

.badge.above-average {
  background: #17a2b8;
  color: white;
}

.badge.below-average {
  background: #ffc107;
  color: #212529;
}

.badge.worst {
  background: #dc3545;
  color: white;
}

/* Session Summary Cards */
.session-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.summary-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-card h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.big-stat {
  font-size: 2rem;
  font-weight: bold;
  color: #007bff;
  font-family: 'Courier New', monospace;
}

/* Insight Cards */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.insight-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.insight-card.positive {
  border-left: 4px solid #28a745;
}

.insight-card.negative {
  border-left: 4px solid #dc3545;
}

.insight-card.neutral {
  border-left: 4px solid #6c757d;
}

.insight-card h4 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.insight-card ul {
  margin-left: 20px;
}

/* Sessions List */
.recent-sessions {
  margin: 30px 0;
}

.sessions-list {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.session-item:last-child {
  border-bottom: none;
}

.session-info strong {
  color: #2c3e50;
}

.session-stats {
  display: flex;
  gap: 15px;
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 5px;
}

.session-actions {
  display: flex;
  gap: 10px;
}

/* Header and Navigation */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.session-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  margin: 5% auto;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
  margin: 0;
  color: #2c3e50;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #f8f9fa;
  color: #495057;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-body .actions {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
}

.modal-footer {
  flex-shrink: 0;
}

/* Utility Components */
.actions {
  display: flex;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 20px;
}

/* Error Messages */
.error-messages {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.error-messages h4 {
  margin-bottom: 10px;
}

.error-messages ul {
  margin-left: 20px;
}

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

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

/* Analytics Section */
.analytics-section {
  margin: 30px 0;
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  font-family: 'Courier New', monospace;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.chart-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  height: 300px;
  position: relative;
}

.improvement-insights {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.insight-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin: 10px 0;
  border-radius: 6px;
  background: #f8f9fa;
}

.insight-item.positive {
  border-left: 4px solid var(--success-color);
  background: #d4edda;
}

.insight-item.negative {
  border-left: 4px solid var(--danger-color);
  background: #f8d7da;
}

.insight-item.neutral {
  border-left: 4px solid var(--secondary-color);
  background: #e2e3e5;
}

.insight-icon {
  font-size: 1.5rem;
  margin-right: 15px;
  min-width: 30px;
}

.insight-text {
  flex: 1;
}

.insight-text strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.insight-text span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive Component Styles */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .header-brand {
    justify-content: center;
  }
  
  .logo {
    height: 50px;
  }
  
  .session-content {
    grid-template-columns: 1fr;
  }
  
  .session-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .session-header .header-brand {
    justify-content: center;
  }
  
  .stopwatches {
    grid-template-columns: 1fr;
  }
  
  .stopwatch-display {
    font-size: 2em;
  }
  
  .session-summary {
    grid-template-columns: 1fr;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    margin: 5% auto;
    max-height: 95vh;
  }
  
  .schedules-grid {
    grid-template-columns: 1fr;
  }
  
  .actions {
    justify-content: center;
  }
  
  .schedule-actions {
    justify-content: center;
  }
  
  .session-actions {
    flex-direction: column;
    align-items: center;
  }
}