/**
 * Card Click Enhancements - Shadcn Zinc 테마와 조화로운 카드 개선 스타일
 * 카드 전체를 클릭 가능하게 만들고 사용자 경험을 향상시키는 스타일
 */

/* 기본 클릭 가능한 카드 스타일 */
.linear-card.card-clickable {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    
    /* Shadcn Zinc 테마 색상 적용 */
    border: 1px solid hsl(var(--border, 240 5.9% 90%));
    background-color: hsl(var(--card, 0 0% 100%));
    color: hsl(var(--card-foreground, 240 10% 3.9%));
}

/* 다크 모드에서 카드 스타일 */
[data-theme='dark'] .linear-card.card-clickable {
    border-color: hsl(var(--border, 240 3.7% 15.9%));
    background-color: hsl(var(--card, 240 10% 3.9%));
    color: hsl(var(--card-foreground, 0 0% 98%));
}

/* 호버 효과 */
.linear-card.card-clickable:hover,
.linear-card.card-clickable.card-hovered {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: hsl(var(--primary, 240 5.9% 10%) / 0.2);
}

/* 다크 모드 호버 효과 */
[data-theme='dark'] .linear-card.card-clickable:hover,
[data-theme='dark'] .linear-card.card-clickable.card-hovered {
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.4),
        0 8px 10px -6px rgba(0, 0, 0, 0.3);
    border-color: hsl(var(--primary, 0 0% 98%) / 0.2);
}

/* 포커스 효과 (키보드 네비게이션) */
.linear-card.card-clickable:focus,
.linear-card.card-clickable.card-focused {
    outline: none;
    ring: 2px solid hsl(var(--primary, 240 5.9% 10%));
    ring-offset: 2px;
    ring-offset-color: hsl(var(--background, 0 0% 100%));
}

/* 다크 모드 포커스 효과 */
[data-theme='dark'] .linear-card.card-clickable:focus,
[data-theme='dark'] .linear-card.card-clickable.card-focused {
    ring-color: hsl(var(--primary, 0 0% 98%));
    ring-offset-color: hsl(var(--background, 240 10% 3.9%));
}

/* 활성 상태 (클릭 시) */
.linear-card.card-clickable:active {
    transform: translateY(-1px);
    transition-duration: 0.1s;
}

/* 카드 내부 아이콘 호버 효과 */
.linear-card.card-clickable:hover .tool-icon {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.linear-card.card-clickable:hover .tool-icon svg {
    color: hsl(var(--primary, 240 5.9% 10%));
}

[data-theme='dark'] .linear-card.card-clickable:hover .tool-icon svg {
    color: hsl(var(--primary, 0 0% 98%));
}

/* 카드 제목 호버 효과 */
.linear-card.card-clickable:hover .linear-card-title {
    color: hsl(var(--primary, 240 5.9% 10%));
    transition: color 0.2s ease;
}

[data-theme='dark'] .linear-card.card-clickable:hover .linear-card-title {
    color: hsl(var(--primary, 0 0% 98%));
}

/* 카드 설명 호버 효과 */
.linear-card.card-clickable:hover .linear-card-description {
    color: hsl(var(--muted-foreground, 240 3.8% 46.1%));
}

[data-theme='dark'] .linear-card.card-clickable:hover .linear-card-description {
    color: hsl(var(--muted-foreground, 240 5% 64.9%));
}

/* 기존 버튼 스타일 유지하면서 개선 */
.linear-card.card-clickable .linear-button {
    pointer-events: auto;
    position: relative;
    z-index: 2;
    transition: all 0.2s ease;
}

.linear-card.card-clickable:hover .linear-button {
    background-color: hsl(var(--primary, 240 5.9% 10%));
    color: hsl(var(--primary-foreground, 0 0% 98%));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] .linear-card.card-clickable:hover .linear-button {
    background-color: hsl(var(--primary, 0 0% 98%));
    color: hsl(var(--primary-foreground, 240 5.9% 10%));
}

/* 모바일 터치 반응성 개선 */
@media (hover: none) and (pointer: coarse) {
    .linear-card.card-clickable:hover {
        transform: none;
    }
    
    .linear-card.card-clickable:active {
        transform: scale(0.98);
        transition-duration: 0.1s;
    }
}

/* 접근성 개선 - 스크린 리더용 */
.linear-card.card-clickable::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .linear-card.card-clickable {
        border-width: 2px;
        border-color: currentColor;
    }
    
    .linear-card.card-clickable:focus {
        outline: 3px solid;
        outline-offset: 2px;
    }
}

/* 애니메이션 감소 설정 지원 */
@media (prefers-reduced-motion: reduce) {
    .linear-card.card-clickable,
    .linear-card.card-clickable:hover,
    .linear-card.card-clickable .tool-icon,
    .linear-card.card-clickable .linear-button {
        transition: none;
        transform: none;
    }
    
    .linear-card.card-clickable:hover {
        box-shadow: 
            0 4px 8px rgba(0, 0, 0, 0.1),
            0 2px 4px rgba(0, 0, 0, 0.05);
    }
}

/* 카드 로딩 상태 (선택적) */
.linear-card.card-loading {
    opacity: 0.6;
    pointer-events: none;
}

.linear-card.card-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: card-loading 1.5s infinite;
}

@keyframes card-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 카드 그룹 개선 */
.linear-grid {
    gap: 1.5rem;
}

.linear-grid .linear-card.card-clickable {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .linear-card.card-clickable {
        margin: 0.5rem 0;
    }
    
    .linear-card.card-clickable:hover {
        transform: translateY(-1px);
    }
    
    .linear-grid {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .linear-card.card-clickable {
        padding: 1rem;
    }
    
    .linear-card.card-clickable:hover .tool-icon {
        transform: scale(1.02);
    }
}

/* 인쇄 시 최적화 */
@media print {
    .linear-card.card-clickable {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .linear-card.card-clickable::after {
        content: " (" attr(aria-label) ")";
        font-size: 0.8em;
        color: #666;
    }
}