/* 커스텀 CSS 스타일 */

/* 네비게이션 탭 스타일 */
.nav-tab {
    background-color: transparent;
    color: #6B7280;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* 탭별 개별 색상 스타일 */
/* 기본 상태: 각 기능별 고유 색상 */
.nav-tab {
    background-color: white;
    color: #6B7280;
}

/* 일정관리 탭 - 기본 상태도 보라색 계열 */
.nav-tab[data-tab="trip-itinerary"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.1));
    color: #8B5CF6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* 방문장소 탭 - 기본 상태도 녹색 계열 */
.nav-tab[data-tab="trip-places"] {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(21, 128, 61, 0.1));
    color: #15803D;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* 사진앨범 탭 - 기본 상태도 적색 계열 */
.nav-tab[data-tab="trip-photos"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 여행경비 탭 - 기본 상태도 파란색 계열 */
.nav-tab[data-tab="trip-expenses"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* 여행일기 탭 - 기본 상태도 진한 파란색 계열 */
.nav-tab[data-tab="trip-diary"] {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(30, 58, 138, 0.1));
    color: #1E40AF;
    border: 1px solid rgba(30, 64, 175, 0.2);
}

/* 일정관리 탭 - 보라색 (활성화 시에만) */
.nav-tab[data-tab="trip-itinerary"].active {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 방문장소 탭 - 진한 녹색 (활성화 시에만) */
.nav-tab[data-tab="trip-places"].active {
    background: linear-gradient(135deg, #22C55E, #15803D);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* 사진앨범 탭 - 적색 (활성화 시에만) */
.nav-tab[data-tab="trip-photos"].active {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 여행경비 탭 - 파란색 (활성화 시에만) */
.nav-tab[data-tab="trip-expenses"].active {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 여행일기 탭 - 진한 파란색 (활성화 시에만) */
.nav-tab[data-tab="trip-diary"].active {
    background: linear-gradient(135deg, #1E40AF, #1E3A8A);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* 여행친구 탭 - 주황색 (활성화 시에만) */
.nav-tab[data-tab="friends"].active {
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* 메인 탭들 (trips, statistics) - 기본 보라색 (활성화 시에만) */
.nav-tab[data-tab="trips"].active,
.nav-tab[data-tab="statistics"].active {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 탭 컨텐츠 애니메이션 */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 카드 스타일 */
.trip-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #F3F4F6;
    overflow: hidden;
    transition: all 0.3s ease;
}

.trip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #8B5CF6;
}

.trip-card-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    padding: 1rem;
    color: white;
}

.trip-card-body {
    padding: 1.5rem;
}

.trip-card-footer {
    padding: 1rem 1.5rem;
    background-color: #F9FAFB;
    border-top: 1px solid #F3F4F6;
}

/* 모달 애니메이션 */
#add-trip-modal {
    animation: modalFadeIn 0.3s ease-out;
}

#add-trip-modal .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 토스트 알림 애니메이션 */
.toast-show {
    animation: toastSlideIn 0.3s ease-out forwards;
}

.toast-hide {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* 로딩 애니메이션 */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
}

/* 폼 요소 스타일 개선 */
input:focus, textarea:focus, select:focus {
    outline: none;
    ring: 2px;
    ring-color: #8B5CF6;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* 버튼 호버 효과 */
.btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

/* 카드 그리드 반응형 */
@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 이미지 스타일 */
.trip-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

/* 뱃지 스타일 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
}

.badge-secondary {
    background-color: #F3F4F6;
    color: #6B7280;
}

/* 통계 카드 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #F3F4F6;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 다크모드 지원 (향후 추가 예정) */
@media (prefers-color-scheme: dark) {
    /* 다크모드 스타일은 나중에 추가 */
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
    .card-hover:hover {
        transform: none;
    }
    
    .trip-card:hover {
        transform: none;
    }
}

/* 접근성 개선 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 링 개선 */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* 애니메이션 감소 설정 존중 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}