/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Navigation */
.navbar {
  background-color: #2c5f2d;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.navbar-brand:hover {
  color: #c9e265;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: white;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #97233f;
  color: white;
}

.btn-primary:hover {
  background-color: #7a1b32;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-xs {
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
}

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

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-info {
  background-color: #17a2b8;
  color: white;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.form-control:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
}

.form-help {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #e9ecef;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* Login Page */
.login-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: #2c5f2d;
}

/* Password Change Page */
.password-change-container {
  max-width: 500px;
  margin: 4rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.password-change-container h1 {
  margin-bottom: 1rem;
  text-align: center;
  color: #2c5f2d;
}

.password-change-container .text-muted {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Calendar Index */
.calendars-index {
  padding: 2rem 0;
}

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

.page-header h1 {
  margin: 0;
  color: #2c5f2d;
}

.calendar-section {
  margin-bottom: 3rem;
}

.calendar-section h2 {
  color: #97233f;
  border-bottom: 2px solid #97233f;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.calendar-section h3 {
  color: #666;
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.calendar-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.calendar-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.calendar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.calendar-card h4 {
  margin: 0 0 0.5rem 0;
}

.calendar-card h4 a {
  color: #2c5f2d;
  text-decoration: none;
}

.calendar-card h4 a:hover {
  text-decoration: underline;
}

.calendar-meta {
  font-size: 0.875rem;
  color: #666;
  margin: 0.25rem 0;
}

.calendar-description {
  color: #555;
  font-style: italic;
  margin: 0.5rem 0;
}

.calendar-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: #666;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Calendar Show Page */
.calendar-show {
  padding: 2rem 0;
}

.calendar-header {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.calendar-header h1 {
  margin: 0 0 0.5rem 0;
  color: #2c5f2d;
}

.calendar-tagline {
  font-size: 1.125rem;
  color: #666;
  font-style: italic;
  margin-bottom: 1rem;
}

.calendar-meta {
  margin-top: 1rem;
}

.creator-preview {
  margin-top: 1rem;
}

.countdown {
  text-align: center;
  font-size: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #97233f 0%, #2c5f2d 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 2rem;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 1024px) {
  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.day-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.day-card.unlocked {
  cursor: pointer;
  border: 2px solid #2c5f2d;
}

.day-card.unlocked:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.day-card.locked {
  opacity: 0.6;
  background: #e9ecef;
  border: 2px solid #ced4da;
}

.day-card.viewed {
  background: #d4edda;
  border-color: #28a745;
}

.day-card.empty {
  border-color: #ffc107;
  background: #fff3cd;
}

.day-link {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.day-number {
  font-size: 2rem;
  font-weight: bold;
  color: #97233f;
  text-align: center;
}

.day-date {
  font-size: 0.875rem;
  color: #666;
  text-align: center;
  margin-top: 0.25rem;
}

.day-locked-content {
  padding: 1rem;
  text-align: center;
}

.lock-icon {
  font-size: 2rem;
  margin-top: 0.5rem;
}

.viewed-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.5rem;
  color: #28a745;
}

.day-status {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  margin-top: 0.5rem;
}

.day-actions {
  padding: 0.5rem;
  border-top: 1px solid #dee2e6;
  text-align: center;
}

.text-muted {
  color: #6c757d;
}

/* Calendar Day Show Page */
.calendar-day-show {
  padding: 2rem 0;
  max-width: 900px;
  margin: 0 auto;
}

.day-header {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  text-align: center;
}

.day-header h1 {
  margin: 0 0 0.5rem 0;
  color: #2c5f2d;
}

.day-title {
  font-size: 1.5rem;
  color: #97233f;
  margin: 1rem 0;
  font-weight: 600;
}

.calendar-title {
  font-size: 1.125rem;
  color: #666;
  margin-bottom: 1rem;
}

.day-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 0.5rem;
}

.creator-actions {
  text-align: center;
  margin-bottom: 2rem;
}

.day-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content-item {
  margin-bottom: 2rem;
}

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

.text-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.content-description {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-left: 4px solid #97233f;
  font-size: 1.125rem;
  line-height: 1.8;
  border-radius: 4px;
}

/* Embedded Content */
.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  border-radius: 8px;
  margin: 1rem 0;
}

.embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.embedded-image {
  max-width: 100%;
  max-height: 600px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 1rem auto;
  border-radius: 8px;
}

/* Calendar Day Edit Page */
.calendar-day-edit {
  padding: 2rem 0;
  max-width: 900px;
  margin: 0 auto;
}

.content-element-form {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.element-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}

.element-header h3 {
  margin: 0;
  color: #2c5f2d;
}

.element-type-badge {
  background: #97233f;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.add-element-section {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.add-element-section h3 {
  color: #2c5f2d;
  margin-top: 0;
}

/* Calendar Form */
.calendar-form {
  max-width: 600px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-form h1 {
  color: #2c5f2d;
  margin-bottom: 1.5rem;
}
