body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  font-family: "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", Meiryo, メイリオ, Osaka, "MS PGothic", arial,
    helvetica, sans-serif;
}

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

.header {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.memo-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.memo-list {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-height: 400px;
  overflow-y: auto;
}

.memo-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.memo-item:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.memo-item.active {
  background: #d4edda;
  border-color: #28a745;
}

.memo-title {
  font-weight: bold;
  color: #495057;
  margin-bottom: 5px;
}

.memo-date {
  font-size: 0.85em;
  color: #6c757d;
}

.memo-preview {
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 8px;
  max-height: 40px;
  overflow: hidden;
}

.btn-custom {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: white;
}

.btn-outline-primary {
  color: #667eea;
  border-color: #667eea;
  padding: 10px 20px;
  border-radius: 25px;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.btn-outline-primary:hover {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.button-group {
  display: flex;
  align-items: center;
}

.backup-buttons {
  display: flex;
  align-items: center;
}

.btn-outline-success {
  color: #28a745;
  border-color: #28a745;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-outline-success:hover {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-outline-warning {
  color: #ffc107;
  border-color: #ffc107;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-outline-warning:hover {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-danger-custom {
  background: linear-gradient(45deg, #dc3545, #c82333);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8em;
}

.btn-danger-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  color: white;
}

.note-editor {
  border-radius: 10px;
  overflow: hidden;
  /* note-editor 의 overflow 해제 (드롭다운이 잘리지 않도록) */
  overflow: visible !important;
}

.empty-state {
  text-align: center;
  color: #6c757d;
  padding: 40px;
}

.empty-state i {
  font-size: 3em;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Summernote Modal Fix */
.note-modal-backdrop {
  z-index: 1050 !important;
}

.note-modal {
  z-index: 1060 !important;
}

/* note-frame.card 의 overflow 해제 */
.note-editor .note-frame.card {
  overflow: visible !important;
}

/* 드롭다운 메뉴 z-index 최상위로 설정 */
.note-editor .note-toolbar .note-dropdown-menu,
.note-editor .note-popover .note-dropdown-menu,
.note-editor .note-popover .dropdown-menu,
.dropdown-menu {
  z-index: 9999 !important;
}

/* Fix for color palette */
.note-color-palette {
  z-index: 1050 !important;
}

/* Fix for dropdown menus */
.note-dropdown-menu {
  min-width: 100px !important;
}

/* Mobile Responsive Styles */
@media (max-width: 470px) {
  .container {
    padding: 10px;
  }

  .header {
    padding: 15px;
    margin-bottom: 15px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .memo-container {
    padding: 15px;
    margin-bottom: 15px;
  }

  .memo-container h4 {
    margin-bottom: 10px !important;
  }

  /* 버튼 영역 모바일 최적화 */
  .memo-container .d-flex.justify-content-between {
    flex-direction: column;
    align-items: stretch !important;
  }

  .memo-container .d-flex.justify-content-between h4 {
    margin-bottom: 15px;
    text-align: center;
  }

  .memo-container .d-flex.justify-content-between > div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }

  /* 버튼 스타일 모바일 최적화 */
  .button-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .btn-custom,
  .btn-outline-primary {
    flex: 1;
    margin: 0 5px !important;
    padding: 12px 10px;
    font-size: 0.9rem;
    text-align: center;
  }

  .btn-custom:first-child,
  .btn-outline-primary:first-child {
    margin-left: 0 !important;
  }

  .btn-custom:last-child,
  .btn-outline-primary:last-child {
    margin-right: 0 !important;
  }

  .btn-custom .mr-1,
  .btn-outline-primary .mr-1 {
    margin-right: 5px !important;
  }

  /* 메모 리스트 헤더 모바일 최적화 */
  .memo-list .d-flex.justify-content-between {
    flex-direction: column;
    align-items: stretch !important;
    gap: 15px;
  }

  .backup-buttons {
    justify-content: center;
    gap: 10px;
  }

  .btn-outline-success,
  .btn-outline-warning {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* 메모 리스트 모바일 최적화 */
  .memo-list {
    padding: 15px;
    max-height: 300px;
  }

  .memo-item {
    padding: 12px;
  }

  .memo-item .d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }

  .memo-item .btn-danger-custom {
    align-self: flex-end;
    margin-top: 10px;
    width: auto;
  }

  /* 제목 입력 필드 */
  #memoTitle {
    font-size: 0.9rem;
  }

  /* Summernote 에디터 모바일 최적화 */
  .note-editor {
    font-size: 0.85rem;
  }

  .note-toolbar {
    padding: 5px;
  }

  .note-toolbar .note-btn {
    padding: 4px 6px;
    font-size: 0.8rem;
  }

  /* 모달 모바일 최적화 */
  .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }

  .modal-content {
    border-radius: 10px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px;
  }

  /* 토스트 알림 모바일 최적화 */
  .toast {
    right: 10px !important;
    top: 10px !important;
    max-width: calc(100% - 20px);
  }
}

/* 추가 작은 화면 최적화 (360px 이하) */
@media (max-width: 360px) {
  .container {
    padding: 5px;
  }

  .header {
    padding: 10px;
  }

  .header h1 {
    font-size: 1.3rem;
  }

  .memo-container,
  .memo-list {
    padding: 10px;
  }

  .btn-custom,
  .btn-outline-primary {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .btn-custom .mr-1,
  .btn-outline-primary .mr-1 {
    margin-right: 3px !important;
  }

  .btn-outline-success,
  .btn-outline-warning {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .memo-item {
    padding: 10px;
  }

  .note-toolbar .note-btn {
    padding: 3px 5px;
    font-size: 0.75rem;
  }
}
