/* ===================================
   KB Cycle Tracker - Custom Styles
   Primary: #ff6b81 (pink)
   Secondary: #7bed9f (green)
   Background: #f9f9f9 (light gray)
   =================================== */

/* Tailwind-like utility classes */
:root {
  --primary: #ff6b81;
  --primary-dark: #e55a6f;
  --primary-light: #ff8a9b;
  --secondary: #7bed9f;
  --secondary-dark: #5dd97d;
  --background: #f9f9f9;
  --text-dark: #2d3436;
  --text-light: #636e72;
  --white: #ffffff;
  --period: #ff6b81;
  --fertile: #7bed9f;
  --risk: #ffa502;
  --safe: #dfe6e9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

/* Splash Screen */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

#splash-screen.fade-out {
  opacity: 0;
}

.splash-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.splash-title {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Login Screen */
#login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 2rem;
}

.login-card {
  background: var(--white);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 350px;
  width: 100%;
}

.login-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-light);
  margin-bottom: 2rem;
}

.btn-google {
  background: var(--white);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f5f5f5;
  border-color: var(--primary);
}

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

/* Setup Screen */
#setup-screen {
  min-height: 100vh;
  background: var(--background);
  padding: 2rem 1.5rem;
}

.setup-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.program-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.program-option {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.program-option.selected {
  border-color: var(--primary);
  background: rgba(255, 107, 129, 0.05);
}

.program-option-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.cycle-inputs {
  margin-top: 1.5rem;
}

.input-group {
  margin-bottom: 1rem;
}

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

.input-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

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

/* Main App */
#app-container {
  display: none;
  padding-bottom: 80px;
}

/* Header */
.app-header {
  background: var(--white);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-greeting {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

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

/* Status Card */
.status-card {
  background: var(--white);
  margin: 1rem;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.status-badge.period {
  background: rgba(255, 107, 129, 0.15);
  color: var(--period);
}

.status-badge.fertile {
  background: rgba(123, 237, 159, 0.15);
  color: var(--fertile);
}

.status-badge.risk {
  background: rgba(255, 165, 2, 0.15);
  color: var(--risk);
}

.status-badge.safe {
  background: rgba(223, 230, 233, 0.3);
  color: var(--text-light);
}

.recommendation {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Calendar */
.calendar-container {
  margin: 1rem;
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

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

.calendar-title {
  font-weight: 700;
  font-size: 1rem;
}

.calendar-nav-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s ease;
}

.calendar-nav-btn:hover {
  color: var(--primary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.5rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day:hover {
  background: var(--background);
}

.calendar-day.period {
  background: var(--period);
  color: var(--white);
}

.calendar-day.fertile {
  background: var(--fertile);
  color: var(--white);
}

.calendar-day.risk {
  background: var(--risk);
  color: var(--white);
}

.calendar-day.safe {
  background: var(--safe);
  color: var(--text-dark);
}

.calendar-day.today {
  border: 2px solid var(--primary);
  font-weight: 700;
}

.calendar-day.selected {
  box-shadow: 0 0 0 3px var(--primary-light);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.has-note::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dark);
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-color.period {
  background: var(--period);
}

.legend-color.fertile {
  background: var(--fertile);
}

.legend-color.risk {
  background: var(--risk);
}

.legend-color.safe {
  background: var(--safe);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.modal-status {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.modal-notes {
  margin: 1rem 0;
}

.modal-notes textarea {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.modal-notes textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s ease;
  background: none;
  border: none;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

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

/* Statistics Page */
.stats-container {
  padding: 1rem;
}

.stats-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.stats-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--background);
  border-radius: 12px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.chart-container {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 12px;
}

.chart-bar {
  height: 24px;
  background: var(--primary);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: width 0.3s ease;
}

/* Reminders Page */
.reminders-container {
  padding: 1rem;
}

.reminder-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.reminder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.reminder-title {
  font-weight: 700;
}

.reminder-date {
  color: var(--text-light);
  font-size: 0.875rem;
}

.btn-add-reminder {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 90px;
  right: 1.5rem;
  box-shadow: 0 4px 20px rgba(255, 107, 129, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-reminder:hover {
  transform: scale(1.05);
}

/* Profile Page */
.profile-container {
  padding: 1rem;
}

.profile-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.profile-email {
  color: var(--text-light);
  font-size: 0.875rem;
}

.profile-section {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.profile-section-title {
  font-weight: 700;
  margin-bottom: 1rem;
}

.profile-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.profile-option:last-child {
  border-bottom: none;
}

.profile-option-label {
  font-weight: 500;
}

.profile-option-value {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e0e0e0;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option.selected {
  border-color: var(--primary);
  background: rgba(255, 107, 129, 0.05);
}

.radio-circle {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  position: relative;
}

.radio-option.selected .radio-circle {
  border-color: var(--primary);
}

.radio-option.selected .radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 107, 129, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Page Transitions */
.page {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }

  #app-container {
    padding-bottom: 1rem;
    max-width: 500px;
    margin: 0 auto;
  }
}
