/* Calendar View Styles */

.view-switcher {
  display: flex;
  gap: 0.5rem;
}

.posts-header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Calendar Container */
.calendar-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.calendar-header {
  padding: 1.5rem;
  border-bottom: 2px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: #f8f9fa;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  min-width: 250px;
  text-align: center;
}

.calendar-period-selector {
  display: flex;
  gap: 0.5rem;
}

.calendar-body {
  padding: 1.5rem;
}

/* Day View */
.calendar-day-container {
  max-width: 900px;
  margin: 0 auto;
}

.calendar-day-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
}

.calendar-day-header h3 {
  margin: 0 0 0.5rem 0;
  color: #212529;
  font-size: 1.75rem;
}

.calendar-day-weekday {
  color: #6c757d;
  font-size: 1.125rem;
}

.calendar-day-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calendar-post-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #dee2e6;
  transition: all 0.2s;
}

.calendar-post-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.calendar-post-item.published {
  border-left-color: #28a745;
  background: #f1f9f3;
}

.calendar-post-item.scheduled {
  border-left-color: #17a2b8;
  background: #f1f9fc;
}

.calendar-post-item.draft {
  border-left-color: #6c757d;
}

.post-time {
  font-size: 1.25rem;
  font-weight: 600;
  color: #495057;
  min-width: 70px;
}

.post-content-preview {
  flex: 1;
}

.post-day-media {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  max-width: 400px;
}

.post-day-thumbnail {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  display: block;
  background: #f8f9fa;
  transition: opacity 0.3s ease-in-out;
}

.post-day-thumbnail[loading="lazy"] {
  opacity: 0;
}

.post-day-thumbnail[loading="lazy"].loaded {
  opacity: 1;
}

.post-day-thumbnail:not([src]),
.post-day-thumbnail[src=""] {
  min-height: 200px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.post-day-thumbnail:not([src])::after,
.post-day-thumbnail[src=""]::after {
  content: "📷";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  opacity: 0.3;
}

.post-day-video-preview {
  position: relative;
  display: inline-block;
  width: 100%;
}

.video-play-icon-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
}

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

.post-title-mini {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.post-title-mini a {
  color: #212529;
  text-decoration: none;
}

.post-title-mini a:hover {
  color: #0088cc;
}

.post-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-text-preview {
  color: #6c757d;
  margin: 0.5rem 0;
  line-height: 1.6;
}

.post-actions-mini {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.calendar-empty-day {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.calendar-empty-day p {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

/* Week View */
.calendar-week-container {
  overflow-x: auto;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  min-width: 900px;
}

.calendar-week-day {
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.calendar-week-day.today {
  background: #e7f3ff;
  box-shadow: 0 0 0 2px #0088cc;
}

.calendar-week-day-header {
  padding: 1rem;
  background: white;
  border-bottom: 2px solid #e9ecef;
  text-align: center;
}

.day-name {
  font-size: 0.875rem;
  color: #6c757d;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.day-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
}

.day-month {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.calendar-week-day-posts {
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-week-post {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  border-left: 3px solid #dee2e6;
  transition: all 0.2s;
  cursor: pointer;
}

.calendar-week-post:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.calendar-week-post.published {
  border-left-color: #28a745;
}

.calendar-week-post.scheduled {
  border-left-color: #17a2b8;
}

.calendar-week-post.draft {
  border-left-color: #6c757d;
}

.post-time-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.post-mini-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-mini-media {
  width: 100%;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.post-mini-thumbnail {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
  background: #f8f9fa;
  transition: opacity 0.3s ease-in-out;
}

.post-mini-thumbnail[loading="lazy"] {
  opacity: 0;
}

.post-mini-thumbnail[loading="lazy"].loaded {
  opacity: 1;
}

.post-mini-thumbnail:not([src]),
.post-mini-thumbnail[src=""] {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.post-mini-thumbnail:not([src])::after,
.post-mini-thumbnail[src=""]::after {
  content: "📷";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.3;
}

.post-mini-video-preview {
  position: relative;
  display: inline-block;
  width: 100%;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
}

.post-mini-link {
  text-decoration: none;
  color: inherit;
}

.post-mini-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #212529;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-mini-text {
  font-size: 0.75rem;
  color: #6c757d;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-mini-status {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.status-icon {
  font-size: 0.875rem;
}

.status-icon.published {
  color: #28a745;
}

.status-icon.scheduled {
  color: #17a2b8;
}

.status-icon.draft {
  color: #6c757d;
}

.media-icon {
  font-size: 0.75rem;
  color: #ffc107;
}

.more-posts-indicator {
  text-align: center;
  font-size: 0.75rem;
  color: #6c757d;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.more-posts-indicator:hover {
  background: rgba(0, 136, 204, 0.1);
  color: #0088cc;
  transform: translateY(-1px);
}

.hidden-posts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  animation: slideDown 0.3s ease-out;
}

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

.calendar-empty-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 5px 0;
}

.add-post-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  color: #0088cc;
  text-decoration: none;
  font-size: 1.5rem;
  border: 2px dashed #dee2e6;
  transition: all 0.2s;
}

.add-post-link:hover {
  background: #0088cc;
  color: white;
  border-color: #0088cc;
  transform: scale(1.1);
}

/* Month View */
.calendar-month-container {
  overflow-x: auto;
}

.calendar-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #dee2e6;
  border: 1px solid #dee2e6;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.weekday-header {
  background: #f8f9fa;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #dee2e6;
  border: 1px solid #dee2e6;
  border-top: none;
  min-height: 600px;
}

.calendar-month-day {
  background: white;
  min-height: 120px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.calendar-month-day.other-month {
  background: #f8f9fa;
  opacity: 0.5;
}

.calendar-month-day.today {
  background: #e7f3ff;
}

.calendar-month-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e9ecef;
}

.day-number {
  font-weight: 600;
  color: #495057;
}

.calendar-month-day-posts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  overflow-x: visible;
}

.calendar-month-post {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-left: 3px solid #dee2e6;
  transition: all 0.2s;
}

.calendar-month-post:hover {
  background: #e9ecef;
}

.calendar-month-post.published {
  border-left-color: #28a745;
  background: #d4edda;
}

.calendar-month-post.scheduled {
  border-left-color: #17a2b8;
  background: #d1ecf1;
}

.calendar-month-post.draft {
  border-left-color: #6c757d;
}

.post-month-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  color: inherit;
}

.post-month-media {
  position: relative;
  flex-shrink: 0;
}

.post-month-thumbnail {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  background: #f8f9fa;
  transition: opacity 0.2s ease-in-out;
}

.post-month-thumbnail[loading="lazy"] {
  opacity: 0;
}

.post-month-thumbnail[loading="lazy"].loaded {
  opacity: 1;
}

.post-month-thumbnail:not([src]),
.post-month-thumbnail[src=""] {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.post-month-thumbnail:not([src])::after,
.post-month-thumbnail[src=""]::after {
  content: "📷";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  opacity: 0.3;
}

.video-play-icon-tiny {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.5rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.post-month-time {
  font-weight: 600;
  color: #495057;
  min-width: 35px;
}

.post-month-title {
  flex: 1;
  color: #212529;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-month-status {
  margin-left: auto;
}

.more-posts-month {
  text-align: center;
  font-size: 0.7rem;
  color: #6c757d;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.more-posts-month:hover {
  background: rgba(0, 136, 204, 0.1);
  color: #0088cc;
}

.hidden-posts-month {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
  animation: slideDown 0.3s ease-out;
}

.calendar-month-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 5px 0;
}

.add-post-month-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: white;
  color: #0088cc;
  text-decoration: none;
  font-size: 1.25rem;
  border: 2px dashed #dee2e6;
  transition: all 0.2s;
}

.add-post-month-link:hover {
  background: #0088cc;
  color: white;
  border-color: #0088cc;
  transform: scale(1.15);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .calendar-week-grid {
    min-width: 700px;
  }

  .calendar-month-day {
    min-height: 100px;
  }
}

@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-navigation {
    justify-content: space-between;
  }

  .calendar-title {
    min-width: auto;
  }

  .calendar-period-selector {
    justify-content: center;
  }

  .calendar-week-grid {
    grid-template-columns: 1fr;
    min-width: auto;
  }

  .calendar-week-day {
    min-height: auto;
  }

  .calendar-month-grid {
    min-height: auto;
  }

  .calendar-month-day {
    min-height: 80px;
  }

  .post-month-title {
    max-width: 100px;
  }

  .posts-header-actions {
    width: 100%;
    flex-direction: column;
  }

  .view-switcher {
    width: 100%;
    justify-content: center;
  }
}

/* Extra small button style */
.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1;
  border-radius: 0.2rem;
}