/* 글꼴 설정 */
.font-inter {
    font-family: 'Inter', sans-serif;
}

/* 탭 스타일 */
.tab-button.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

/* 타임라인 그리드 스타일 */
.timeline-grid {
    min-height: 500px;
    border: 1px solid #e5e7eb;
}

.timeline-header {
    display: grid;
    grid-template-columns: 200px repeat(7, 1fr);
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.timeline-header-cell {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-right: 1px solid #e5e7eb;
}

.timeline-row {
    display: grid;
    grid-template-columns: 200px repeat(7, 1fr);
    border-bottom: 1px solid #e5e7eb;
}

.timeline-customer-cell {
    padding: 8px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

.timeline-date-cell {
    padding: 4px;
    border-right: 1px solid #e5e7eb;
    min-height: 60px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.timeline-date-cell:hover {
    background-color: #e0f2fe;
    border: 2px solid #0284c7;
}

.timeline-date-cell.cursor-pointer:hover::after {
    content: '클릭하여 접촉 기록 추가';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}

.timeline-date-cell.has-contact {
    background-color: #dbeafe;
}

.timeline-date-cell.overdue {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
}

.contact-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3b82f6;
    margin: 2px auto;
    position: relative;
}

.contact-dot.phone { background-color: #10b981; }
.contact-dot.email { background-color: #f59e0b; }
.contact-dot.meeting { background-color: #8b5cf6; }
.contact-dot.text { background-color: #06b6d4; }

.contact-tooltip {
    position: absolute;
    background-color: #374151;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.contact-dot:hover .contact-tooltip {
    opacity: 1;
}

.recommendation-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* 고객 리스트 테이블 스타일 */
.status-badge {
    display: inline-flex;
    items-center;
    px-2.5;
    py-0.5;
    rounded-full;
    text-xs;
    font-medium;
}

.status-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

/* 모달 스타일 */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* 컨텍스트 메뉴 스타일 */
.context-menu {
    position: absolute;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    min-width: 160px;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.context-menu-item:hover {
    background-color: #f3f4f6;
}

.context-menu-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.context-menu-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* 로딩 상태 */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .timeline-grid {
        font-size: 12px;
    }
    
    .timeline-header {
        grid-template-columns: 160px repeat(7, 1fr);
    }
    
    .timeline-row {
        grid-template-columns: 160px repeat(7, 1fr);
    }
    
    .timeline-customer-cell {
        padding: 6px 4px;
        font-size: 11px;
        min-height: 50px;
    }
    
    .timeline-date-cell {
        min-height: 50px;
    }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 접촉 이력 모달 개선 스타일 */
.contact-history-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.contact-history-item {
    transition: all 0.2s ease-in-out;
}

.contact-history-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 접촉 유형별 텍스트 색상 */
.text-green-600 { color: #059669; }
.text-green-700 { color: #047857; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-purple-600 { color: #9333ea; }
.text-purple-700 { color: #7c3aed; }
.text-orange-600 { color: #ea580c; }
.text-orange-700 { color: #c2410c; }

/* 접촉 유형별 테두리 색상 */
.border-green-400 { border-color: #4ade80; }
.border-blue-400 { border-color: #60a5fa; }
.border-purple-400 { border-color: #a78bfa; }
.border-orange-400 { border-color: #fb923c; }

/* 주말 스타일 */
.weekend-header {
    background-color: #f8f9fa !important;
    color: #6b7280 !important;
}

.weekend-cell {
    background-color: #f8f9fa !important;
    opacity: 0.7;
    cursor: not-allowed !important;
}

.weekend-cell:hover {
    background-color: #f8f9fa !important;
    border: 1px solid #e5e7eb !important;
}

.weekend-cell:hover::after {
    content: '주말은 접촉 추천 없음';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #6b7280;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}