/* ============================================================================
 * Life Calendar - Unified Component Styles
 * ============================================================================
 *
 * This file provides consistent styling for all UI components across the app.
 * Primary color: #2c3e50 (from navbar theme)
 *
 * Usage:
 *   - Add class names to your HTML elements
 *   - Override variables with CSS custom properties if needed
 *
 * ============================================================================ */

/* ============================================================================
 * CSS Variables (Theme)
 * ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Primary Colors */
  --lc-primary: #2c3e50;
  --lc-primary-hover: #34495e;
  --lc-primary-light: #ecf0f1;

  /* Accent Colors */
  --lc-accent: #3498db;
  --lc-accent-hover: #2980b9;

  /* Status Colors */
  --lc-success: #27ae60;
  --lc-success-hover: #229954;
  --lc-warning: #f39c12;
  --lc-warning-hover: #e67e22;
  --lc-danger: #e74c3c;
  --lc-danger-hover: #c0392b;
  --lc-info: #16a085;
  --lc-info-hover: #138d75;

  /* Neutral Colors */
  --lc-bg-white: #ffffff;
  --lc-bg-gray: #f8f9fa;
  --lc-bg-gray-dark: #e9ecef;
  --lc-text-dark: #2c3e50;
  --lc-text-gray: #6c757d;
  --lc-text-light: #95a5a6;
  --lc-border: #dee2e6;
  --lc-border-light: #e9ecef;

  /* Shadows */
  --lc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --lc-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --lc-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --lc-radius-sm: 4px;
  --lc-radius: 8px;
  --lc-radius-lg: 12px;
  --lc-radius-xl: 16px;

  /* Transitions */
  --lc-transition-fast: 0.15s ease;
  --lc-transition: 0.2s ease;
  --lc-transition-slow: 0.3s ease;

  /* Z-Index */
  --lc-z-overlay: 2000;
  --lc-z-modal: 2001;
  --lc-z-dropdown: 1000;
  --lc-z-sticky: 100;
}

/* ============================================================================
 * Overlay (Modal Backdrop)
 * ============================================================================ */
.lc-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(44, 62, 80, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--lc-z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--lc-transition), visibility var(--lc-transition);
}

.lc-overlay.lc-open {
  opacity: 1;
  visibility: visible;
}

/* ============================================================================
 * Modal
 * ============================================================================ */
.lc-modal {
  background-color: var(--lc-bg-white);
  border-radius: var(--lc-radius-lg);
  box-shadow: var(--lc-shadow-lg);
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--lc-transition);
}

.lc-overlay.lc-open .lc-modal {
  transform: scale(1) translateY(0);
}

/* Larger modal variant */
.lc-modal.lc-modal-lg {
  max-width: 540px;
}

/* Full-width mobile */
@media (max-width: 480px) {
  .lc-modal {
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* ============================================================================
 * Modal Header
 * ============================================================================ */
.lc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--lc-border);
  background-color: var(--lc-bg-gray);
}

.lc-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--lc-text-dark);
}

.lc-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: var(--lc-radius-sm);
  color: var(--lc-text-gray);
  cursor: pointer;
  transition: background-color var(--lc-transition-fast), color var(--lc-transition-fast);
}

.lc-modal-close:hover {
  background-color: var(--lc-bg-gray-dark);
  color: var(--lc-text-dark);
}

/* ============================================================================
 * Modal Body
 * ============================================================================ */
.lc-modal-body {
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
}

/* No padding variant */
.lc-modal-body.lc-body-no-padding {
  padding: 0;
}

/* ============================================================================
 * Modal Footer
 * ============================================================================ */
.lc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--lc-border);
  background-color: var(--lc-bg-gray);
}

/* Left-aligned actions */
.lc-modal-footer.lc-footer-left {
  justify-content: flex-start;
}

/* Both sides */
.lc-modal-footer.lc-footer-between {
  justify-content: space-between;
}

/* ============================================================================
 * Form Elements
 * ============================================================================ */
.lc-form-group {
  margin-bottom: 16px;
}

.lc-form-group:last-child {
  margin-bottom: 0;
}

.lc-form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--lc-text-dark);
}

.lc-form-label.lc-label-required::after {
  content: " *";
  color: var(--lc-danger);
}

.lc-form-input,
.lc-form-select,
.lc-form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--lc-text-dark);
  background-color: var(--lc-bg-white);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  transition: border-color var(--lc-transition), box-shadow var(--lc-transition);
}

.lc-form-input:focus,
.lc-form-select:focus,
.lc-form-textarea:focus {
  outline: none;
  border-color: var(--lc-primary);
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.lc-form-input.lc-input-error,
.lc-form-select.lc-input-error,
.lc-form-textarea.lc-input-error {
  border-color: var(--lc-danger);
}

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

.lc-form-error {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--lc-danger);
}

.lc-form-hint {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--lc-text-light);
}

/* ============================================================================
 * Buttons
 * ============================================================================ */
.lc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--lc-radius);
  cursor: pointer;
  transition: background-color var(--lc-transition), color var(--lc-transition),
              transform var(--lc-transition-fast), box-shadow var(--lc-transition);
}

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

.lc-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--lc-shadow-sm);
}

.lc-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: none;
}

/* Primary Button */
.lc-btn-primary {
  background-color: var(--lc-primary);
  color: var(--lc-primary-light);
}

.lc-btn-primary:hover:not(:disabled) {
  background-color: var(--lc-primary-hover);
}

/* Secondary Button */
.lc-btn-secondary {
  background-color: var(--lc-bg-gray);
  color: var(--lc-text-dark);
  border: 1px solid var(--lc-border);
}

.lc-btn-secondary:hover:not(:disabled) {
  background-color: var(--lc-bg-gray-dark);
}

/* Danger Button */
.lc-btn-danger {
  background-color: var(--lc-danger);
  color: white;
}

.lc-btn-danger:hover:not(:disabled) {
  background-color: var(--lc-danger-hover);
}

/* Ghost Button */
.lc-btn-ghost {
  background-color: transparent;
  color: var(--lc-text-gray);
}

.lc-btn-ghost:hover:not(:disabled) {
  background-color: var(--lc-bg-gray);
  color: var(--lc-text-dark);
}

/* Link Button */
.lc-btn-link {
  background-color: transparent;
  color: var(--lc-accent);
  padding: 8px 12px;
}

.lc-btn-link:hover:not(:disabled) {
  background-color: rgba(52, 152, 219, 0.1);
}

/* Button Sizes */
.lc-btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.lc-btn-lg {
  padding: 14px 24px;
  font-size: 1.05rem;
}

/* ============================================================================
 * Section Dividers
 * ============================================================================ */
.lc-divider {
  height: 1px;
  background-color: var(--lc-border);
  margin: 20px 0;
}

.lc-divider.lc-divider-thick {
  height: 2px;
}

.lc-divider.lc-divider-vertical {
  width: 1px;
  height: 100%;
  margin: 0 20px;
}

/* Text Divider */
.lc-divider-text {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--lc-text-light);
  font-size: 0.9rem;
}

.lc-divider-text::before,
.lc-divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--lc-border);
}

.lc-divider-text::before {
  margin-right: 12px;
}

.lc-divider-text::after {
  margin-left: 12px;
}

/* ============================================================================
 * Cards
 * ============================================================================ */
.lc-card {
  background-color: var(--lc-bg-white);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius-lg);
  padding: 20px;
  box-shadow: var(--lc-shadow-sm);
}

.lc-card-header {
  margin-bottom: 16px;
}

.lc-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--lc-text-dark);
}

.lc-card-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--lc-text-gray);
}

/* ============================================================================
 * Lists
 * ============================================================================ */
.lc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lc-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lc-border-light);
  transition: background-color var(--lc-transition-fast);
}

.lc-list-item:last-child {
  border-bottom: none;
}

.lc-list-item:hover {
  background-color: var(--lc-bg-gray);
}

.lc-list-item.lc-list-item-clickable {
  cursor: pointer;
}

/* ============================================================================
 * Utility Classes
 * ============================================================================ */
/* Text */
.lc-text-muted { color: var(--lc-text-gray); }
.lc-text-danger { color: var(--lc-danger); }
.lc-text-success { color: var(--lc-success); }
.lc-text-warning { color: var(--lc-warning); }

/* Spacing */
.lc-mt-0 { margin-top: 0; }
.lc-mt-1 { margin-top: 4px; }
.lc-mt-2 { margin-top: 8px; }
.lc-mt-3 { margin-top: 12px; }
.lc-mt-4 { margin-top: 16px; }

.lc-mb-0 { margin-bottom: 0; }
.lc-mb-1 { margin-bottom: 4px; }
.lc-mb-2 { margin-bottom: 8px; }
.lc-mb-3 { margin-bottom: 12px; }
.lc-mb-4 { margin-bottom: 16px; }

/* Display */
.lc-hidden { display: none !important; }
.lc-flex { display: flex; }
.lc-flex-center { display: flex; align-items: center; justify-content: center; }
.lc-flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ============================================================================
 * Toast Notifications
 * ============================================================================ */
.lc-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.lc-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  background-color: var(--lc-bg-white);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow-lg);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lc-toast-show {
  opacity: 1;
  transform: translateX(0);
}

.lc-toast-hide {
  opacity: 0;
  transform: translateX(100%);
}

.lc-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  font-weight: bold;
  border-radius: 50%;
}

.lc-toast-message {
  flex: 1;
  font-size: 0.95rem;
  color: var(--lc-text-dark);
}

.lc-toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--lc-text-light);
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-toast-close:hover {
  color: var(--lc-text-dark);
}

/* Toast types */
.lc-toast-success {
  border-left: 4px solid var(--lc-success);
}

.lc-toast-success .lc-toast-icon {
  background-color: rgba(39, 174, 96, 0.15);
  color: var(--lc-success);
}

.lc-toast-error {
  border-left: 4px solid var(--lc-danger);
}

.lc-toast-error .lc-toast-icon {
  background-color: rgba(231, 76, 60, 0.15);
  color: var(--lc-danger);
}

.lc-toast-warning {
  border-left: 4px solid var(--lc-warning);
}

.lc-toast-warning .lc-toast-icon {
  background-color: rgba(243, 156, 18, 0.15);
  color: var(--lc-warning);
}

.lc-toast-info {
  border-left: 4px solid var(--lc-info);
}

.lc-toast-info .lc-toast-icon {
  background-color: rgba(22, 160, 133, 0.15);
  color: var(--lc-info);
}

/* ============================================================================
 * Confirm Dialog
 * ============================================================================ */
.lc-confirm-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(44, 62, 80, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--lc-z-modal);
  align-items: center;
  justify-content: center;
}

.lc-confirm-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}

.lc-confirm-content {
  background-color: var(--lc-bg-white);
  border-radius: var(--lc-radius-lg);
  box-shadow: var(--lc-shadow-lg);
  max-width: 400px;
  width: 100%;
  padding: 24px;
  animation: lcConfirmFadeIn 0.2s ease;
}

@keyframes lcConfirmFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lc-confirm-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--lc-text-dark);
  margin-bottom: 12px;
}

.lc-confirm-message {
  font-size: 0.95rem;
  color: var(--lc-text-gray);
  margin-bottom: 20px;
  line-height: 1.5;
}

.lc-confirm-input-wrapper {
  margin-bottom: 20px;
}

.lc-confirm-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius-sm);
  background-color: var(--lc-bg-white);
  color: var(--lc-text-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lc-confirm-input:focus {
  border-color: var(--lc-accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.lc-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.lc-confirm-actions .lc-btn {
  min-width: 70px;
}

/* ============================================================================
 * Mind Voice App
 * ============================================================================ */
.mv-mindvoice-wrapper {
  height: 100%;
  padding: 0;
}

.mv-mindvoice-container {
  display: flex;
  height: 500px;
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  overflow: hidden;
}

/* Sidebar */
.mv-mindvoice-sidebar {
  width: 280px;
  background-color: var(--lc-bg-gray);
  border-right: 1px solid var(--lc-border);
  display: flex;
  flex-direction: column;
}

.mv-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--lc-border);
}

.mv-sidebar-header h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lc-text-dark);
}

.mv-admin-stats {
  font-size: 0.85rem;
  color: var(--lc-text-gray);
  padding: 8px;
  background-color: var(--lc-bg-white);
  border-radius: var(--lc-radius);
  text-align: center;
}

.mv-sidebar-header button {
  width: 100%;
}

/* Filter tabs */
.mv-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--lc-border);
}

.mv-filter-tab {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.8rem;
  background: none;
  border: none;
  border-radius: var(--lc-radius-sm);
  cursor: pointer;
  color: var(--lc-text-gray);
  transition: all var(--lc-transition);
}

.mv-filter-tab:hover {
  background-color: var(--lc-bg-white);
}

.mv-filter-tab.mv-active {
  background-color: var(--lc-primary);
  color: white;
}

.mv-voice-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.mv-voice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--lc-radius);
  cursor: pointer;
  transition: background-color var(--lc-transition);
  position: relative;
}

.mv-voice-item:hover {
  background-color: var(--lc-bg-white);
}

.mv-voice-item.mv-selected {
  background-color: var(--lc-primary-light);
}

.mv-voice-item.mv-unread {
  font-weight: 600;
}

.mv-voice-item.mv-unread::after {
  content: '';
  position: absolute;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--lc-danger);
  border-radius: 50%;
}

.mv-voice-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mv-voice-info {
  flex: 1;
  min-width: 0;
}

.mv-voice-title {
  font-size: 0.9rem;
  color: var(--lc-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv-voice-date {
  font-size: 0.75rem;
  color: var(--lc-text-light);
  margin-top: 2px;
}

.mv-voice-user {
  font-size: 0.8rem;
  color: var(--lc-text-dark);
  font-weight: 500;
}

.mv-user-email {
  font-size: 0.75rem;
  color: var(--lc-text-light);
  margin-left: 4px;
}

.mv-delete-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity var(--lc-transition);
}

.mv-delete-btn:hover {
  opacity: 1;
}

.mv-empty-list {
  text-align: center;
  padding: 32px 16px;
  color: var(--lc-text-light);
  font-size: 0.9rem;
}

/* Main Content */
.mv-mindvoice-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mv-voice-detail {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.mv-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--lc-text-light);
  font-size: 0.95rem;
}

.mv-detail-header {
  margin-bottom: 16px;
}

.mv-detail-title {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--lc-text-dark);
}

.mv-detail-date {
  font-size: 0.85rem;
  color: var(--lc-text-light);
}

.mv-detail-content {
  padding: 16px 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--lc-text-dark);
  white-space: pre-wrap;
  border-bottom: 1px solid var(--lc-border);
}

.mv-user-info {
  padding: 12px 0;
  font-size: 0.9rem;
  color: var(--lc-text-gray);
  border-bottom: 1px solid var(--lc-border-light);
  margin-bottom: 16px;
}

/* Admin Reply */
.mv-admin-reply {
  margin-top: 20px;
  padding: 16px;
  background-color: var(--lc-bg-gray);
  border-radius: var(--lc-radius);
  border-left: 4px solid var(--lc-info);
}

.mv-reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}

.mv-reply-delete-btn {
  margin-left: auto;
  padding: 4px 8px;
  font-size: 0.75rem;
  background-color: var(--lc-danger);
  color: white;
  border: none;
  border-radius: var(--lc-radius-sm);
  cursor: pointer;
  transition: opacity var(--lc-transition);
}

.mv-reply-delete-btn:hover {
  opacity: 0.8;
}

.mv-reply-icon {
  font-size: 1.2rem;
}

.mv-reply-author {
  font-weight: 600;
  color: var(--lc-text-dark);
}

.mv-reply-date {
  font-size: 0.8rem;
  color: var(--lc-text-light);
  margin-left: auto;
}

.mv-reply-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--lc-text-dark);
  white-space: pre-wrap;
}

.mv-no-reply {
  margin-top: 20px;
  padding: 12px 16px;
  background-color: var(--lc-bg-gray);
  border-radius: var(--lc-radius);
  color: var(--lc-text-light);
  font-size: 0.9rem;
  text-align: center;
}

/* Reply form for admin */
.mv-reply-form-container {
  margin-top: 24px;
  padding: 16px;
  background-color: var(--lc-bg-gray);
  border-radius: var(--lc-radius);
}

.mv-reply-form-container h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lc-text-dark);
}

.mv-reply-textarea {
  width: 100%;
  min-height: 100px;
}

.mv-has-reply {
  background-color: rgba(46, 204, 113, 0.1);
  border-left-color: var(--lc-success);
}

.mv-detail-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Form */
.mv-form-container {
  padding: 0;
}

.mv-form-container h3 {
  margin: 0 0 20px 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.mv-char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--lc-text-light);
  margin-top: 4px;
}

.mv-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .mv-mindvoice-container {
    flex-direction: column;
    height: auto;
    min-height: 500px;
  }

  .mv-mindvoice-sidebar {
    width: 100%;
    max-height: 200px;
  }

  .mv-mindvoice-main {
    min-height: 400px;
  }
}
