/*
 * 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.
 */

@import url("/assets/mobile_tooltip-253be48a.css");
@import url("/assets/care_heatmap-65ad2f73.css");

/* Content area link styles only - not for UI elements */
.markdown-content a,
.content-area a,
.text-content a {
  color: #ea580c; /* text-orange-600 */
  text-decoration: underline;
  transition: color 0.2s ease-in-out;
}

.markdown-content a:hover,
.content-area a:hover,
.text-content a:hover {
  color: #9a3412; /* text-orange-800 */
}

.markdown-content a:visited,
.content-area a:visited,
.text-content a:visited {
  color: #ea580c; /* Same as normal link color */
}

.markdown-content a:visited:hover,
.content-area a:visited:hover,
.text-content a:visited:hover {
  color: #9a3412; /* Same as hover color */
}

/* Dark mode content link styles */
.dark .markdown-content a,
.dark .content-area a,
.dark .text-content a {
  color: #fb923c; /* text-orange-400 */
}

.dark .markdown-content a:hover,
.dark .content-area a:hover,
.dark .text-content a:hover {
  color: #fed7aa; /* text-orange-300 */
}

.dark .markdown-content a:visited,
.dark .content-area a:visited,
.dark .text-content a:visited {
  color: #fb923c; /* Same as normal link color in dark mode */
}

.dark .markdown-content a:visited:hover,
.dark .content-area a:visited:hover,
.dark .text-content a:visited:hover {
  color: #fed7aa; /* Same as hover color in dark mode */
}

/* Drag and Drop Styles */
.sortable-ghost {
  opacity: 0.4;
  background: #f3f4f6;
  border: 2px dashed #9ca3af;
}

.sortable-chosen {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sortable-drag {
  opacity: 0.8;
  transform: rotate(2deg);
}

.dark .sortable-ghost {
  background: #374151;
  border-color: #6b7280;
}

/* Resizable panels */
.resizable-panel {
  transition: width 0.2s ease-in-out;
}

.resizable-panel.resizing {
  transition: none;
}

.resizer {
  cursor: col-resize;
  user-select: none;
}

/* Custom monospace font override - 더 구체적인 선택자로 우선순위 확보 */
.font-mono,
footer .font-mono,
footer p.font-mono,
body .font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* White background for routine images - 더 구체적인 선택자 사용 */
body .routine-image,
body img.routine-image {
  background-color: white;
  background: white;
  opacity: 1;
  visibility: visible;
  display: block;
  z-index: 1;
}

/* Dark mode에서도 흰색 배경 유지 */
body.dark .routine-image,
html.dark body .routine-image,
.dark img.routine-image {
  background-color: white;
  background: white;
}

/* Pseudo elements 제거 */
.routine-image::before,
.routine-image::after {
  display: none;
  content: none;
  background-color: transparent;
}

/* Hide scrollbar */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

/* Line clamp utilities for consistent text truncation */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  hyphens: auto;
}

/* Ensure proper text truncation in routine cards - 더 구체적인 선택자 사용 */
.routine-description-preview,
body .routine-description-preview,
.routine-card .routine-description-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: calc(1.4em * 3);
}

/* Fallback for browsers that don't support -webkit-line-clamp */
@supports not (-webkit-line-clamp: 3) {
  .routine-description-preview {
    position: relative;
    max-height: calc(1.4em * 3); /* line-height * 3 lines */
    overflow: hidden;
  }
  
  .routine-description-preview:after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent 0%, white 70%);
    padding-left: 20px;
    color: #374151;
    font-weight: normal;
  }
  
  .dark .routine-description-preview:after {
    background: linear-gradient(to right, transparent 0%, #2A2A2A 70%);
    color: #A5A5A5;
  }
}

/* Additional safeguards for text overflow */
.routine-description-preview * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Calendar click-based tooltips */
.tooltip {
  pointer-events: none; /* 툴팁 자체는 클릭 불가 */
}

/* Resizable panels */
.resizable-panel {
  flex-shrink: 0;
  overflow: hidden;
  transition: none; /* 리사이즈 중에는 애니메이션 비활성화 */
}

.resizable-panel.resizing {
  transition: none;
  pointer-events: none; /* 리사이즈 중에는 클릭 방지 */
}

/* Resizer handle improvements */
[data-resizable-target="resizer"] {
  cursor: col-resize;
  user-select: none;
  flex-shrink: 0;
  touch-action: none; /* 터치에서도 잘 동작하도록 */
}

[data-resizable-target="resizer"]:hover {
  background-color: rgba(156, 163, 175, 0.2); /* gray-400 with opacity */
}

/* Dark mode resizer handle */
.dark [data-resizable-target="resizer"]:hover {
  background-color: rgba(75, 85, 99, 0.3); /* gray-600 with opacity */
}

/* Prevent text selection during resize - body에 직접 적용으로 우선순위 확보 */
body.user-select-none,
body.user-select-none * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* reCAPTCHA 배지 숨기기 - 더 구체적인 선택자로 우선순위 확보 */
body .grecaptcha-badge,
html body .grecaptcha-badge {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  bottom: -100px;
  right: -100px;
  width: 0;
  height: 0;
  z-index: -1000;
  pointer-events: none;
  display: none;
}

/* iframe도 숨기기 - 더 구체적인 선택자 사용 */
body iframe[src*="recaptcha"],
html body iframe[src*="recaptcha"] {
  display: none;
  visibility: hidden;
  position: fixed;
  bottom: -100px;
  right: -100px;
  width: 0;
  height: 0;
  z-index: -1000;
}

/* 가로 스크롤 방지 - root 레벨에만 적용 */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* 메인 컨테이너 overflow 제한 */
#root, .app-container, main {
  overflow-x: hidden;
}

/* 박스 사이징 설정 */
* {
  box-sizing: border-box;
}
