/* Mom Calendar - Main Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  flex: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
  border-bottom: 3px solid #667eea;
}

header h1 {
  font-size: 2.5rem;
  color: #667eea;
  margin-bottom: 10px;
}

header p {
  font-size: 1.2rem;
  color: #666;
}

/* Navigation */
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
}

nav li {
  margin: 0 15px;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
  background: #667eea;
  color: white;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 50px;
  padding: 40px 0;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 15px;
  color: white;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 15px;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  margin: 0 10px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

.btn-secondary {
  color: white;
  background: #5a67d8;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #667eea;
}

/* Feature Grid */
.features {
  margin-bottom: 50px;
}

.features h3 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: #667eea;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.feature-card {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 2px solid #f0f0f0;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.feature-card h4 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #333;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
}

/* Quick Stats */
.quick-stats {
  margin-bottom: 50px;
}

.quick-stats h3 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: #667eea;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 1rem;
  opacity: 0.9;
}

/* Calendar Specific Styles */
.calendar-container {
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.calendar-section {
  margin-bottom: 50px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.calendar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.month-title {
  font-size: 1.8rem;
  color: #333;
  margin: 0;
  font-weight: 600;
}

.calendar-grid {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #667eea;
}

.weekday {
  padding: 15px;
  text-align: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e0e0e0;
}

.calendar-day {
  background: white;
  min-height: 120px;
  padding: 10px;
  border: 1px solid #f0f0f0;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.calendar-day:hover {
  background: #f8f9ff;
}

.calendar-day.other-month {
  background: #fafafa;
  color: #ccc;
}

.calendar-day.today {
  background: rgba(235, 119, 119, 0.831);
  border: 2px solid red;
}

.day-number {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #333;
}

.other-month .day-number {
  color: #ccc;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-event {
  background: #667eea;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-event:hover {
  background: #556cd6;
  transform: scale(1.02);
}

.day-event.all-day {
  background: #28a745;
}

.day-event.category-personal {
  background: #e74c3c;
}

.day-event.category-work {
  background: #f39c12;
}

.day-event.category-family {
  background: #9b59b6;
}

.day-event.category-health {
  background: #1abc9c;
}

.events-overflow {
  font-size: 0.6rem;
  color: #666;
  text-align: center;
  padding: 2px;
  margin-top: 2px;
}

.event-list {
  /* max-height: 400px;
  overflow-y: auto; */
}

.event-item {
  background: #f8f9fa;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.event-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.event-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.event-date {
  color: #666;
  font-size: 0.9rem;
}

.event-category {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 5px;
}

/* API Documentation Styles */
.api-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.api-endpoint {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin: 10px 0;
  border-left: 4px solid #28a745;
}

.api-method {
  font-weight: bold;
  color: #28a745;
  display: inline-block;
  width: 80px;
}

.api-url {
  font-family: monospace;
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Loading Animation */
.loading {
  text-align: center;
  padding: 20px;
}

.loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Main content should grow to push footer down */
main {
  flex: 1;
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 0;
  border-top: 2px solid #f0f0f0;
  color: #666;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 2rem;
  }

  nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .btn {
    display: block;
    margin: 10px auto;
    text-align: center;
    max-width: 200px;
  }

  .calendar-header {
    flex-direction: column;
    gap: 15px;
  }

  .calendar-container {
    padding: 15px;
  }

  .calendar-day {
    min-height: 80px;
    padding: 5px;
  }

  .day-number {
    font-size: 0.8rem;
  }

  .day-event {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .weekday {
    padding: 10px 5px;
    font-size: 0.8rem;
  }

  .month-title {
    font-size: 1.4rem;
  }
}

/* Event Details Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  position: relative;
  animation: slideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 25px 30px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px 15px 0 0;
  position: relative;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.close {
  color: white;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.event-detail {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.event-detail:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-label {
  font-weight: 600;
  color: #555;
  width: 110px;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.detail-value {
  color: #333;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: capitalize;
}

/* Category color themes */
.category-badge.work {
  background: #e8f4fd;
  color: #2196f3;
}
.category-badge.personal {
  background: #f3e5f5;
  color: #9c27b0;
}
.category-badge.family {
  background: #e8f5e8;
  color: #4caf50;
}
.category-badge.health {
  background: #fff3e0;
  color: #ff9800;
}
.category-badge.education {
  background: #fce4ec;
  color: #e91e63;
}
.category-badge.travel {
  background: #e0f2f1;
  color: #009688;
}

/* Mobile responsiveness for modal */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-header {
    padding: 20px 25px 15px;
  }

  .event-detail {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-label {
    width: auto;
    margin-bottom: 5px;
  }
}

/* Day Events Modal List Styles */
.day-events-list {
  max-height: 400px;
  overflow-y: auto;
}

.day-event-item {
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.day-event-item:hover {
  background-color: #f8f9fa;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.day-event-item:last-child {
  margin-bottom: 0;
}

.day-event-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 1rem;
}

.day-event-time {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.day-event-location {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
}

/* Calendar Header Layout */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Modal Actions */
.modal-actions {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="datetime-local"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="color"] {
  width: 60px;
  height: 40px;
  padding: 2px;
  cursor: pointer;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.1);
}

.form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
}

/* Required field indicator */
.form-group label:has(+ input[required]):after {
  content: " *";
  color: #e74c3c;
}

/* Button sizing */
.btn {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.btn.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
}

.btn.btn-secondary {
  background: #6c757d;
  border: none;
  color: white;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness for form */
@media (max-width: 600px) {
  .calendar-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .calendar-nav {
    justify-content: space-between;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

/* Day View Styles */
.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.day-navigation {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.day-nav-btn {
  padding: 8px 12px;
  border: none;
  background: #667eea;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.day-nav-btn:hover {
  background: #5a6fd8;
}

.day-nav-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.current-day-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  margin: 0 20px;
  min-width: 250px;
  text-align: center;
}

.date-picker-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-picker {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  background: white;
}

.date-picker:focus {
  outline: none;
  border-color: #667eea;
}

.day-actions {
  display: flex;
  gap: 10px;
}

/* Day Events Container */
.day-content {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.day-events-section {
  margin-bottom: 30px;
}

.day-events-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.3rem;
  color: #667eea;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

.day-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-event-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.day-event-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: #667eea;
}

.event-time {
  font-size: 0.9rem;
  color: #e5e3e3;
  margin-bottom: 8px;
  font-weight: 500;
}

.event-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.event-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.4;
}

.event-location {
  color: #555;
  font-size: 0.9rem;
}

.event-category {
  align-self: flex-start;
}

/* No Events Message */
.no-events-container {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.no-events-container h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #999;
}

.no-events-container p {
  font-size: 1.1rem;
  margin-bottom: 25px;
  color: #aaa;
}

#add-first-event-btn {
  background: #28a745;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#add-first-event-btn:hover {
  background: #218838;
}

/* Category color coding for day events */
.day-event-card.category-work {
  border-left: 4px solid #007bff;
}

.day-event-card.category-personal {
  border-left: 4px solid #28a745;
}

.day-event-card.category-family {
  border-left: 4px solid #fd7e14;
}

.day-event-card.category-health {
  border-left: 4px solid #dc3545;
}

.day-event-card.category-social {
  border-left: 4px solid #6f42c1;
}

.day-event-card.category-travel {
  border-left: 4px solid #20c997;
}

/* Responsive design for day view */
@media (max-width: 768px) {
  .day-header {
    flex-direction: column;
    gap: 15px;
  }

  .day-navigation {
    flex-wrap: wrap;
    justify-content: center;
  }

  .current-day-title {
    font-size: 1.2rem;
    min-width: auto;
    margin: 0;
  }

  .day-actions {
    width: 100%;
    justify-content: center;
  }

  .day-event-card {
    padding: 12px;
  }

  .event-title {
    font-size: 1rem;
  }

  .date-picker-container {
    flex-wrap: wrap;
  }
}

/* Full-width layout for index page */
.full-width .container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 20px;
}

/* Day view layout - minimum 50% width */
.day-view .container {
  min-width: 50%;
  width: max(50%, 800px);
  max-width: 90%;
}
