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

body {
    font-family: 'Noto sans Japanese', 'M PLUS 1p', 'Helvetica Neue', 'Arial', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic ProN', 'メイリオ', 'Meiryo', 'sans-serif';
  line-height: 1.6;
  color: #333;
  background: linear-gradient(to right, #2563eb, #1e40af);
  min-height: 100vh;
}

.nav-btn{
  padding:3%;
}
.calendar-title{
  font-size:20px;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header (Mobile First) */
.header {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

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

.logo-icon {
  background: #2563eb;
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.logo-text p {
  font-size: 0.875rem;
  color: #6b7280;
}

.nav-menu {
  display: none; /* Hidden by default for mobile (controlled by JS for hamburger) */
  flex-direction: column;
  position: absolute;
  top: 4rem; /* Header height */
  left: 0;
  width: 100%;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  gap: 0;
}

.nav-menu.active {
  display: flex;
  z-index: 100;
}

.nav-menu .nav-link {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.nav-menu .nav-link:last-child {
  border-bottom: none;
}

.admin-btn {
  display: none; /* Hidden by default for mobile */
}

.mobile-menu-btn {
  display: flex; /* Visible by default for mobile */
  flex-direction: column;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 1.5rem;
  height: 2px;
  background: #374151;
  transition: all 0.3s;
}

/* Main Content (Mobile First) */
.main-content {
  padding: 2rem 0 0 0;
}

.page-title {
  text-align: center;
  margin-bottom: 3rem;
}

.page-title h1 {
  font-size: 2.0rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
}

.page-title p {
  font-size: 1rem;
  color: #ffffff;

  margin: 0 auto;
  line-height: 1.75;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column for mobile */
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Card Styles (Mobile First) */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.card-header h2,
.card-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header02 {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.card-header02 h2,
.card-header02 h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}



.card-header h3 {
  font-size: 1.25rem;
}

.card-header p {
  color: #6b7280;
  margin-top: 0.5rem;
}

.card-content {
  padding: 1.5rem;
}

/* Calendar Styles (Mobile First) */
.calendar {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  width: 100%;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f9fafb;
}

.day-header {
  padding: 0.5rem 0.25rem; /* Smaller padding for mobile */
  text-align: center;
  font-weight: 600;
  color: #374151;
  border-right: 1px solid #e5e7eb;
  min-height: 2.5rem; /* Smaller min-height for mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem; /* Smaller font size for mobile */
}

.day-header:last-child {
  border-right: none;
}

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

.calendar-day {
  min-height: 3rem; /* Smaller min-height for mobile */
  padding: 0.25rem; /* Smaller padding for mobile */
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  font-weight: 500;
  font-size: 0.875rem; /* Smaller font size for mobile */
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:hover {
  background: #f3f4f6;
}

.calendar-day.selected {
  background: #dbeafe;
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 2px #3b82f6;
}

.calendar-day.other-month {
  color: #9ca3af;
  background: #f9fafb;
}

.calendar-day.holiday {
  background: #fee2e2;
  color: #dc2626;
}

.calendar-day.event {
  background: #dcfce7;
  color: #16a34a;
}

.calendar-day.test {
  background: #fefce8; /* yellow-100 */
  color: #92400e; /* yellow-800 */
}

.calendar-day.other {
  background: #f3e8ff;
  color: #7c3aed;
}

.calendar-day.today {
  font-weight: 700;
  background: #fef3c7;
  border: 2px solid #f59e0b;
}

/* Sidebar (Mobile First) */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.notices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notice-item {
  font-size :15px;
  padding: 0.75rem;
  border-left: 4px solid;
  background: #eff6ff;
  border-radius: 0.375rem;
}

.notice-item.holiday {
  border-left-color: #ef4444; /* red-500 */
  background: #fee2e2; /* red-100 */
}

.notice-item.event {
  border-left-color: #10b981; /* green-500 */
  background: #dcfce7; /* green-100 */
}

.notice-item.test {
  border-left-color: #eab308; /* yellow-500 */
  background: #fefce8; /* yellow-100 */
}

.notice-item.other {
  border-left-color: #7c3aed; /* purple-600 */
  background: #f3e8ff; /* purple-100 */
}

.notice-item h4 {
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.notice-item.holiday h4,
.notice-item.holiday p {
  color: #dc2626; /* red-600 */
}

.notice-item.event h4,
.notice-item.event p {
  color: #16a34a; /* green-600 */
}

.notice-item.test h4,
.notice-item.test p {
  color: #a16207; /* yellow-700 */
}

.notice-item.other h4,
.notice-item.other p {
  color: #7c3aed; /* purple-600 */
}

.download-btn {
  font-size :18px;
  width: 100%;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
}

.download-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.access-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
   color: #333333;
 
}

.info-section h4 {
 font-weight: 400;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-section p {
 font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Event List (Mobile First) */
.event-list-section {
  grid-column: 1 / -1;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.event-item:hover {
  background: #f9fafb;
}

.event-item h4 {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.event-item p {
  font-size: 0.875rem;
  color: #6b7280;
  margin-left: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
  /* white-space: nowrap; を削除済み */
}

.badge.normal {
  background: #dbeafe;
  color: #1e40af;
}

.badge.holiday {
  background: #fee2e2;
  color: #dc2626;
}

.badge.event {
  background: #dcfce7;
  color: #16a34a;
}

.badge.test {
  background: #fefce8; /* yellow-100 */
  color: #92400e; /* yellow-800 */
  border: 1px solid #fef08a; /* yellow-200 */
}

.badge.other {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
}

/* Notice Box (Mobile First) */
.notice-box {
  padding: 1rem;
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.notice-box h4 {
  font-weight: 600;
  color: #a16207;
  margin-bottom: 0.5rem;
}

.notice-box p {
  font-size: 0.875rem;
  color: #a16207;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.action-btn {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Footer (Mobile First) */
.footer {
  margin-top: 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr; /* Single column for mobile */
  gap: 2rem;
  padding: 3rem 0;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  grid-column: 1 / -1; /* Always span full width on mobile */
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.footer-logo p {
  color: #9ca3af;
}

.footer-main p {
  color: #9ca3af;
  font-size: 0.875rem;
}

.footer-links {
  display: contents; /* Allows columns to be direct children of grid */
}

.footer-column h4 {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: white;
}

.footer-bottom {
  color: #ffffff;
  padding: 1rem 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
}

/* Modal Styles (Mobile First) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 90%; /* Default width for mobile */
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 800px;
}

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

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-content {
  padding: 1.5rem;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr; /* Single column for mobile */
  gap: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  flex-direction: column; /* Stack buttons for mobile */
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.btn-primary {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Event List Actions (Mobile First) */
.event-list-actions {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center; /* Center for mobile */
}

/* Registered Events (Mobile First) */
.registered-events {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  background: #f9fafb;
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.event-card-title {
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background: #f59e0b;
  color: white;
}

.btn-edit:hover {
  background: #d97706;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

.event-card-info {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.event-card-description {
  font-size: 0.875rem;
  color: #374151;
}

.event-period {
  font-weight: 500;
  color: #2563eb;
}

/* Legend (Mobile First) */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem; /* Smaller gap for mobile */
  margin-bottom: 1rem;
  font-size: 0.8rem; /* Smaller font size for mobile */
  justify-content: center; /* Center for mobile */
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.legend-color {
  width: 0.875rem; /* Smaller size for mobile */
  height: 0.875rem; /* Smaller size for mobile */
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.legend-color.normal {
  background: #3b82f6;
}

.legend-color.holiday {
  background: #ef4444;
}

.legend-color.event {
  background: #10b981;
}

.legend-color.test {
  background: #eab308; /* yellow-500 */
}

.legend-color.other {
  background: #7c3aed;
}

/* Desktop Styles (min-width: 769px) */
@media (min-width: 769px) {
  /* Header */
  .nav-menu {
    display: flex; /* Show on desktop */
    flex-direction: row;
    position: static;
    top: auto;
    left: auto;
    width: auto;
    background: none;
    box-shadow: none;
    padding: 0;
    gap: 2rem;
  }

  .nav-menu .nav-link {
    padding: 0;
    border-bottom: none;
  }

  .admin-btn {
    display: flex; /* Show on desktop */
  }

  .mobile-menu-btn {
    display: none; /* Hide on desktop */
  }

  /* Main Content */
  .content-grid {
    grid-template-columns: 2fr 1fr; /* Two columns for desktop */
  }

  /* Calendar */
  .day-header {
    padding: 0.75rem;
    min-height: 3rem;
    font-size: 1rem;
  }

  .calendar-day {
    min-height: 4rem;
    padding: 0.5rem;
    font-size: 1rem;
  }

  /* Form */
  .form-row {
    grid-template-columns: 1fr 1fr; /* Two columns for desktop */
  }

  .form-actions {
    flex-direction: row; /* Row for desktop */
  }

  /* Event List Actions */
  .event-list-actions {
    justify-content: flex-end; /* Align right for desktop */
  }

  /* Legend */
  .legend {
    justify-content: flex-start; /* Align left for desktop */
    gap: 1rem;
    font-size: 0.875rem;
  }

  .legend-color {
    width: 1rem;
    height: 1rem;
  }
}

/* Larger Desktop Styles (min-width: 1025px) */
@media (min-width: 1025px) {
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr; /* Three columns for larger desktop */
  }

  .footer-main {
    grid-column: auto; /* Remove full width span */
  }
}
