
/* Keen Slider 커스터마이징 */
.keen-slider {
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
}

.keen-slider__slide {
    width: auto !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
}


/* 탭 버튼 스타일 유지 */
#tab-container .keen-slider__slide button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 숫자 포맷팅 깜빡임 방지 */
.format-number {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.format-number.formatted {
    opacity: 1;
}

/* 제목 줄 제한 (line-clamp) 지원 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 이벤트 카드 높이 및 간격 조정 */
.event-card-container {
    min-height: 180px !important; /* 카드 높이 증가 */
}

.event-card-content {
    padding: 24px !important; /* 내용 패딩 증가 */
    gap: 16px !important; /* 요소 간 간격 증가 */
}

/* 채팅카드 고정 스타일 - 반응형 */
@media (max-width: 768px) {
    .sticky-chat-card {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
    }
}

@media (min-width: 769px) {
    .sticky-chat-card {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
    }
}

/* Speed Dial 반응형 스타일 */
@media (max-width: 768px) {
    .speed-dial-container {
        bottom: 1rem !important;
        right: 1rem !important;
    }
    
    .speed-dial-button {
        width: 48px !important;
        height: 48px !important;
    }
    
    .speed-dial-main-button {
        width: 52px !important;
        height: 52px !important;
    }
}

@media (max-width: 480px) {
    .speed-dial-container {
        bottom: 0.75rem !important;
        right: 0.75rem !important;
    }
    
    .speed-dial-button {
        width: 44px !important;
        height: 44px !important;
    }
    
    .speed-dial-main-button {
        width: 48px !important;
        height: 48px !important;
    }
}

.event-card-title {
    margin-bottom: 16px !important; /* 제목 하단 간격 증가 */
    line-height: 1.5 !important; /* 제목 줄 간격 조정 */
}

.event-card-meta {
    gap: 12px !important; /* 메타 정보 간격 증가 */
}

.event-card-meta-item {
    margin-bottom: 8px !important; /* 각 메타 항목 간격 */
}

/* 이미지 컨테이너가 카드 전체 높이를 채우도록 조정 */
.event-card-container .relative.overflow-hidden.w-48.h-32.flex-shrink-0 {
    height: 100% !important; /* 카드 전체 높이에 맞춤 */
    min-height: 180px !important; /* 최소 높이 설정 */
}

/* 팝업 관련 추가 스타일 */
.popup-layer {
    overflow: visible;
    will-change: transform, opacity;
}

/* 팝업 콘텐츠 컨테이너 */
.popup-content-container {
    overflow: hidden;
}

/* 팝업 이미지 라운드 처리 */
.popup-content-container img {
    border-radius: 0.5rem 0.5rem 0 0 !important; /* 상단 모서리만 라운드 */
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

.popup-content-container img:first-child {
    border-radius: 0.5rem 0.5rem 0 0 !important; /* 첫 번째 이미지의 상단 모서리 라운드 */
}

.popup-content img {
    width: 400px !important;
    height: 600px !important;
    max-width: 400px !important;
    max-height: 600px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
}

.popup-content {
    width: 400px;
    height: 600px;
    overflow: hidden;
    padding: 0;
    border-radius: 0; 
}

.popup-drag-handle {
    position: relative;
    width: 400px;
    min-width: 400px;
    height: 28px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: move;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
}

.popup-drag-handle:active {
    cursor: grabbing;
    background: linear-gradient(to bottom, #e9ecef 0%, #dee2e6 100%);
}

.popup-drag-indicator {
    width: 40px;
    height: 4px;
    background-color: #adb5bd;
    border-radius: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.popup-drag-handle:hover .popup-drag-indicator {
    opacity: 1;
    background-color: #6c757d;
}

.popup-content {
    cursor: grab;
    user-select: none;
}

.popup-content:active {
    cursor: grabbing;
}

.popup-footer {
    width: 400px;
    min-width: 400px;
    border-radius: 0 0 0.5rem 0.5rem;
}

.popup-content a {
    display: block;
}

.popup-content img {
    pointer-events: none; 
    user-select: none;
    -webkit-user-drag: none; 
}

[id^="popup"] {
    width: 400px !important;
    min-width: 400px !important;
}

/* 모바일 최적화 */
@media (max-width: 767px) {
    [id^="popup"] {
        width: calc(100vw - 40px) !important;
        max-width: 90vw !important;
        height: auto !important;
        max-height: calc(100vh - 40px) !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .popup-content {
        width: 100% !important;
        height: auto !important;
        max-height: calc(100vh - 140px) !important;
        overflow-y: auto !important;
    }
    
    .popup-content img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
    }
    
    .popup-drag-handle,
    .popup-footer {
        width: 100% !important;
        min-width: auto !important;
    }
    .popup-layer {
        max-width: calc(100vw - 2rem) !important;
        width: calc(100vw - 2rem) !important;
    }
    
    .popup-layer .absolute {
        position: absolute !important;
    }
}

/* 포커스 트랩을 위한 스타일 */
.popup-layer:focus {
    outline: none;
}

/* 이미지가 컨테이너를 완전히 채우도록 조정 */
.event-card-container .relative.overflow-hidden.w-48.h-32.flex-shrink-0 img {
    height: 100% !important; /* 컨테이너 전체 높이 */
    object-fit: cover !important; /* 비율 유지하며 컨테이너 채우기 */
    object-position: center !important; /* 이미지 중앙 정렬 */
}

/* 상태 표기를 카드 오른쪽 하단으로 이동 */
.event-status-badge {
    position: absolute !important;
    bottom: 12px !important;
    right: 12px !important;
    top: auto !important;
    left: auto !important;
    z-index: 10 !important;
}

/* 가로형 이벤트 카드 레이아웃을 위한 모바일 반응형 스타일 */
@media (max-width: 640px) {
    .grid.grid-cols-1.lg\\:grid-cols-2 .flex {
        flex-direction: column;
    }
    
    .grid.grid-cols-1.lg\\:grid-cols-2 .w-48.h-32 {
        width: 100% !important;
        height: 200px !important;
    }
    
    .event-card-container {
        min-height: 220px !important; /* 모바일에서 더 큰 높이 */
    }
}

/* 모바일 메뉴 최적화를 위한 CSS 스타일 추가 */
#mobile-menu {
    transform: translateY(-100%);
    opacity: 0;
}

#mobile-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

/* 모바일 드롭다운 애니메이션 */
.mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

.mobile-dropdown-menu:not(.hidden) {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
}

input[type="checkbox"] {
    border-style: solid !important;
    border-width: 1px !important;
    border-color: #8d76f6 !important;
}

#mobile-user-info {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 터치 친화적 버튼 크기 */
@media (max-width: 768px) {
    .mobile-dropdown-toggle,
    #mobile-menu a {
        min-height: 48px;
        touch-action: manipulation;
    }
}

/* Flowbite 모달 전용: 스크롤 방지 및 레이아웃 점프 방지 */
/* 모달이 활성화된 상태를 나타내는 클래스 */
body.modal-active {
    scrollbar-gutter: stable;
}

/* Flowbite 모달이 열릴 때 overflow-hidden과 함께 적용 */
body.modal-active.overflow-hidden {
    overflow: hidden;
}

/* 최신 브라우저용: :has() 선택자 지원 시 자동 감지 */
@supports selector(:has(*)) {
    /* 모달이 열릴 때만 스크롤바 공간 유지 */
    body:has([data-modal-show="true"]) {
        scrollbar-gutter: stable;
    }
    
    /* 활성화된 모달이 있을 때만 적용 */
    body:has(.fixed.inset-0.z-50:not(.hidden)) {
        scrollbar-gutter: stable;
    }
}

/* 헤더 내비게이션: 스크롤바 숨김 및 한글 단어단위 줄바꿈 유지 */
.no-scrollbar::-webkit-scrollbar {
		display: none;
}

.no-scrollbar {
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.break-keep {
	word-break: keep-all;
}

/* 구형 브라우저 대체: Flowbite가 인라인 스타일로 overflow를 설정할 때 */
body.overflow-hidden[style*="overflow"] {
    scrollbar-gutter: stable;
}

/* 이미지 전용 팝업 스타일 */
.popup-image-only {
    overflow: hidden;
}

.popup-image-only .popup-content-container {
    padding: 0 !important;
}

.popup-image-only img {
    display: block;
    width: 100%;
    height: auto;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* 커스텀 스크롤바 디자인 */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 104, 112, 0.3) transparent;
}

/* Webkit 브라우저용 스크롤바 스타일 */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}

/* ========================================
   📜 스크롤바 디자인 (여기서 색상 변경 가능!)
   ======================================== */
.attendance-message-scroll {
    /* 스크롤바 색상 변경하려면 아래 값을 수정하세요 */
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent; /* 연한 회색 */
}

/* Chrome, Safari, Edge용 스크롤바 */
.attendance-message-scroll::-webkit-scrollbar {
    width: 4px; /* 스크롤바 두께 */
}

.attendance-message-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db; /* 스크롤바 색상 (여기서 변경!) */
    border-radius: 8px;
}

.attendance-message-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af; /* 마우스 올렸을 때 색상 */
}

/* ========================================
   드래그 스크롤 기능
   ======================================== */
.cursor-grabbing {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
}

#attendance-table-scroll {
    -webkit-overflow-scrolling: touch; /* iOS 스크롤 부드럽게 */
}

/* 드래그 중 텍스트 선택 방지 */
#attendance-table-scroll.cursor-grabbing * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}
@media (max-width: 1535px) {
    .container {
        max-width: 100% !important;
        padding-left: 0.5rem; /* 기존 px-1 유지 */
		padding-right: 0.5rem;
    }
}
@media (max-width: 1373px) {
    #desktop-search-container {
        display: none;
    }
}
@media (max-width: 1280px) {
	.container {
		max-width: 100% !important;
		padding-left: 0.5rem; /* 기존 px-1 유지 */
		padding-right: 0.5rem;
	}
}
/* 1024px 미만에서 컨테이너 폭 최적화 */
@media (max-width: 1023px) {
	.container {
		max-width: 100% !important;
		padding-left: 0.5rem; /* 기존 px-1 유지 */
		padding-right: 0.5rem;
	}
}
/* Korean text should not break per character on small screens */
.break-keep {
	word-break: keep-all;
}

/* ========================================
   Input Autofill 스타일 처리
   ======================================== */
/* 검색 입력창의 브라우저 자동완성 스타일 제거 */
#search-input:-webkit-autofill,
#search-input:-webkit-autofill:hover,
#search-input:-webkit-autofill:focus,
#search-input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 30px transparent inset !important;
	-webkit-text-fill-color: white !important;
	transition: background-color 5000s ease-in-out 0s;
}

/* ========================================
   Password Reset Modal - Step Indicator Styles
   ======================================== */

/* Progress bar - must be behind icons */
#progress-bar {
	z-index: 0 !important;
}

/* Step icons - always on top with very high z-index */
.step-active,
.step-completed,
.step-pending {
	position: relative !important;
	z-index: 999 !important;
}

.step-active {
	background-color: #8d76f6 !important;
	border-color: #8d76f6 !important;
	color: #ffffff !important;
}

.step-completed {
	background-color: #ffffff !important;
	border-color: #8d76f6 !important;
	color: #8d76f6 !important;
}

.step-pending {
	background-color: #ffffff !important;
	border-color: #e5e7eb !important;
	color: #9ca3af !important;
}

/* Dark mode support */
.dark .step-pending {
	background-color: #374151 !important;
	border-color: #6b7280 !important;
	color: #9ca3af !important;
}

.dark .step-completed {
	background-color: #374151 !important;
	border-color: #8d76f6 !important;
	color: #8d76f6 !important;
}
