/* Servis Delfin Branding Colors */
:root {
  --primary-blue: #1A4E7A;
  --secondary-blue: #2C7FB8;
  --accent-blue: #5DA9DD;
  --background: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 80px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.login-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.login-input {
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.875rem;
  width: 120px;
  min-width: 80px;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.login-btn, .register-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.login-btn:hover, .register-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile Header Styles */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem;
  }

  .header-content {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .logo {
    justify-content: center;
  }

  .logo-text {
    font-size: 1.125rem;
  }

  .user-section {
    justify-content: center;
  }

  .login-form {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .login-inputs-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .login-input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .login-buttons-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .login-btn, .register-btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
  }

  .register-btn {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
  }

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

@media (max-width: 480px) {
  .logo-text {
    font-size: 1rem;
  }

  .login-btn, .register-btn {
    font-size: 0.9rem;
    padding: 0.65rem;
  }
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.user-name {
  font-weight: 500;
}

.signout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.signout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Week Selector */
.week-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 72px;
  z-index: 90;
}

/* Mobile Boat Navigation */
.mobile-nav {
  display: none;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 144px;
  z-index: 85;
}

.boat-selector {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  color: var(--text);
}

@media (max-width: 768px) {
  .mobile-nav {
    display: block;
  }
}

/* Day Tabs */
.day-tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 216px;
  z-index: 80;
  padding: 0 1rem;
}

.tab-button {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-light);
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.tab-button.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  background: rgba(26, 78, 122, 0.05);
}

.tab-button:hover:not(.active) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.02);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

@media (min-width: 769px) {
  .day-tabs {
    top: 144px;
  }
}

/* Highlight animation */
@keyframes highlight {
  0% { 
    box-shadow: 0 0 0 4px var(--accent-blue);
    transform: scale(1.02);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(93, 169, 221, 0.3);
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(93, 169, 221, 0);
    transform: scale(1);
  }
}

.week-btn {
  background: var(--accent-blue);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.week-btn:hover {
  background: var(--secondary-blue);
  transform: scale(1.05);
}

.week-info {
  text-align: center;
}

.week-display {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-blue);
}

.dates-display {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Main Content */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.content {
  padding: 1rem 0;
}

/* Day Sections */
.day-section {
  margin-bottom: 2rem;
}

.section-header {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary-blue);
}

.section-header.sticky {
  position: static;
}

.section-header h2 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* Progress Bars */
.progress-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-item label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
}

.progress-bar {
  position: relative;
  background: #F3F4F6;
  border-radius: 8px;
  height: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-blue), var(--accent-blue));
  border-radius: 8px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text);
  z-index: 2;
}

.breakdown-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Boats Grid */
.boats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

/* Boat Cards */
.boat-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.boat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.boat-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  padding: 1rem;
}

.boat-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.boat-content {
  padding: 1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: #F3F4F6;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.segmented-control input[type="radio"] {
  display: none;
}

.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.875rem;
  margin: 0;
}

.segmented-control input[type="radio"]:checked + label {
  background: var(--primary-blue);
  color: white;
  box-shadow: var(--shadow);
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.checkbox-item:hover {
  background: rgba(26, 78, 122, 0.03);
  border-color: var(--border);
}

.checkbox-item:active {
  transform: scale(0.98);
}

.checkbox-item > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox:checked {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox + label {
  cursor: pointer;
  font-weight: 500;
  margin: 0;
  flex: 1;
  pointer-events: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .checkbox-item {
    padding: 0.75rem;
    border-radius: 8px;
  }

  .checkbox {
    width: 24px;
    height: 24px;
  }

  .checkbox:checked::after {
    font-size: 14px;
  }

  .boat-header .boat-name {
    color: white;
    font-weight: bold;
  }
}

/* Note Input */
.note-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 44px;
  transition: border-color 0.2s;
}

.note-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(93, 169, 221, 0.1);
}

/* Update Info */
.update-info {
  font-size: 0.5rem;
  color: var(--text-light);
  font-style: italic;
}

.update-info:empty {
  display: none;
}

.checkbox:not(:checked) + label + .update-info {
  display: none;
}

/* Floating Action Buttons */
.fab-container {
  position: fixed;
  bottom: 100px;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 70;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:hover {
  background: var(--secondary-blue);
  transform: scale(1.1);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-light);
  transition: all 0.2s;
  min-height: 64px;
  justify-content: center;
}

.nav-item.active {
  color: var(--primary-blue);
  background: rgba(26, 78, 122, 0.05);
}

.nav-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Overview Specific Styles */
.overview-content {
  padding: 1rem 0 2rem;
}

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

.overview-section h2 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.progress-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.progress-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.progress-card h3 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.kpi-tile {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.kpi-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Departure Grid */
.departure-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

.departure-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.departure-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.departure-card h3 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.125rem;
  text-align: center;
}

.departure-count {
  text-align: center;
  margin-bottom: 1rem;
}

.count-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--secondary-blue);
  margin-bottom: 0.25rem;
}

.count-label {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
}

.departure-boats {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.departure-boats.hidden {
  display: none;
}

.departure-boat-item {
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.departure-boat-item:last-child {
  margin-bottom: 0;
}

/* Leaderboard */
.leaderboard-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.leaderboard-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--primary-blue);
  color: white;
  font-weight: 600;
}

.leaderboard-list {
  max-height: 300px;
  overflow-y: auto;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.leaderboard-rank {
  width: 24px;
  height: 24px;
  background: var(--accent-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
}

.leaderboard-name {
  font-weight: 500;
}

.leaderboard-actions {
  color: var(--primary-blue);
  font-weight: bold;
}

/* Notes Dashboard */
.notes-dashboard {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.notes-filter {
  display: flex;
  background: #F9FAFB;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

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

.notes-list {
  max-height: 400px;
  overflow-y: auto;
}

.note-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.note-boat {
  font-weight: 600;
  color: var(--primary-blue);
}

.note-day {
  font-size: 0.875rem;
  color: var(--text-light);
  background: #F3F4F6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.note-content {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #F3F4F6;
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-light);
  font-style: italic;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Tablet Styles */
@media (min-width: 768px) {
  .boats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .progress-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .progress-bars {
    flex-direction: row;
    gap: 1rem;
  }
  
  .progress-item {
    flex: 1;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .fab-container {
    right: 2rem;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .boats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .main {
    padding: 0 2rem;
  }
  
  .content {
    padding: 2rem 0;
  }
  
  .overview-content {
    padding: 2rem 0 3rem;
  }
}

/* Boat Tables */
.boat-tables {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

.table-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.table-container h3 {
  margin-bottom: 1rem;
  color: var(--primary-blue);
  font-size: 1.125rem;
  font-weight: 600;
}

.boat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.boat-table th {
  background-color: var(--primary-blue);
  color: white;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--secondary-blue);
}

.boat-table th:first-child {
  border-radius: 8px 0 0 0;
}

.boat-table th:last-child {
  border-radius: 0 8px 0 0;
}

.boat-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.boat-table tr:hover {
  background-color: rgba(26, 78, 122, 0.05);
}

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

.boat-name {
  font-weight: 500;
  color: var(--text);
}

.checkmark-cell {
  text-align: center;
  font-size: 1.125rem;
  color: var(--success);
  font-weight: bold;
  width: 120px;
}

@media (min-width: 768px) {
  .boat-tables {
    grid-template-columns: 1fr 1fr;
  }

  .boat-table {
    font-size: 0.9rem;
  }

  .checkmark-cell {
    width: 140px;
  }
}