/*
  Octarule Project
  Author: Keith (Arc.Keith)
  Created: July 2025
  License: Creative Commons Attribution 4.0 International (CC BY 4.0)
  https://creativecommons.org/licenses/by/4.0/
*/

body {
      font-family: sans-serif;
      background: #121212;
      color: #f0f0f0;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }

    main {
  flex: 1;
  padding: 1rem; /* Default padding */
  display: block; /* or flex-direction: column only if needed */
  max-width: 960px;
  margin: 0 auto;
}


    section {
      margin: 1rem 0;
      text-align: center;
    }

    input[type="date"] {
      padding: 0.5rem;
      font-size: 1rem;
      border-radius: 0.3rem;
      border: 1px solid #666;
      background-color: #1e1e1e;
      color: #f0f0f0;
      margin-right: 0.5rem;
    }

    button {
      padding: 0.5rem 1rem;
      font-size: 1rem;
      background-color: #3f509d;
      color: white;
      border: none;
      border-radius: 0.3rem;
      cursor: pointer;
    }

    button:hover[onclick="convertToKerrian()"] {
      background-color: #5f6fbf;
    }

    #result {
      font-size: 1.25rem;
      margin-top: 1rem;
      color: #a8b4f0;
    }

    #holiday-chart {
      padding: 2rem;
      text-align: center;
    }

    #holiday-chart h2 {
      color: #a8b4f0;
      margin-bottom: 1rem;
    }

    #holiday-chart table {
      width: 100%;
      max-width: 700px;
      margin: 0 auto;
      border-collapse: collapse;
      font-size: 1rem;
    }

    #holiday-chart th, #holiday-chart td {
      border: 1px solid #444;
      padding: 0.75rem;
      text-align: center;
    }

    #holiday-chart th {
      background-color: #3f509d;
      color: white;
    }

    #holiday-chart tr:nth-child(even) {
      background-color: #1f1f1f;
    }

    #holiday-chart tr:nth-child(odd) {
      background-color: #2a2a2a;
    }

    #holiday-chart td {
      color: #eee;
    }

/* Kerian Weekday Grid Styles */
.weekday-grid {
  display: grid;
  /* Reduced minmax to allow items to shrink smaller */
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); /* Adjusted minmax */
  gap: 1rem;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem; /* Default padding for the grid */
}

.weekday {
  background: #111;
  border-radius: 1rem;
  text-align: center;
  transition: transform 0.3s;
}

.weekday:hover {
  transform: scale(1.05);
}

.weekday img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  border-radius: 0.5rem;
}

.weekday span {
  display: block;
  color: #ddd;
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
  margin-top: 0.3rem;
}

/* Responsive column tweaks */
/* On screens up to 850px, force 4 columns (4x2 layout) */
@media (max-width: 850px) {
  .weekday-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .weekday {
    padding: 1rem; 
  }
}

/* On screens up to 600px, switch to 3 columns for smaller phones */
@media (max-width:600px) {
  .weekday-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem; /* Slightly reduced gap */
  }
  .weekday {
    padding: 0.7rem; /* Slightly reduced padding */
  }
}

/* New breakpoint for even smaller screens, still maintaining 3 columns */
@media (max-width: 480px) {
  .weekday-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem; /* Further reduced gap */
    padding: 0.5rem; /* Add some padding to the grid itself if main has none */
  }
  .weekday {
    padding: 0.4rem; /* Further reduced padding */
  }
  .weekday span {
    font-size: 0.8rem; /* Make text smaller to fit */
  }

  /* Adjustments for Holiday Chart on small screens */
  #holiday-chart th, #holiday-chart td {
    padding: 0.4rem; /* Reduced padding for table cells */
    font-size: 0.85rem; /* Reduced font size for table cells */
  }
}

.weekday.has-note {
  border: 2px solid #3f509d;
  background: #1a1a1a;
}




.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: #1e1e1e;
  color: white;
  padding: 1.5rem;
  border-radius: 1rem;
  max-width: 400px;
  width: 90%;
}
.modal-content textarea {
  width: 100%;
  height: 150px;
  background: #121212;
  color: #eee;
  border: 1px solid #555;
  border-radius: 0.5rem;
  padding: 0.5rem;
  resize: vertical;
  font-family: monospace;
  font-size: 1rem;
}
.modal-content button {
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  background: #3f509d;
  color: white;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
}


#clearAllNotes {
  background: #912f2f;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
#clearAllNotes:hover {
  background: #b13c3c;
}