/* 모바일 최적화를 위한 CSS */

/* 기본 반응형 설정 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 헤더 모바일 스타일 */
    .header {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .header-logo-text {
        display: none;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    /* 메인 콘텐츠 모바일 스타일 */
    .main-content {
        margin-left: 0;
        padding-top: 4.5rem;
    }
    
    /* 도구 카드 그리드 조정 */
    .tools-container {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
    }
    
    /* 사이드바 모바일 스타일 */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        z-index: 1001;
        transition: left 0.3s ease;
        border-radius: 0;
        border-right: 1px solid var(--glass-border);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .dark .sidebar {
        border-right: 1px solid var(--dark-glass-border);
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .dark .sidebar.active {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }
    
    /* 도구 상세 페이지 모바일 스타일 */
    .tool-details {
        padding: 1.25rem;
        border-radius: 0.75rem;
        margin: 0.5rem;
    }
    
    .tool-details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    /* 푸터 모바일 스타일 */
    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 모바일에서 테마 토글 버튼 위치 조정 */
    .theme-toggle {
        position: fixed;
        right: 1rem;
        bottom: 5rem;
        z-index: 90;
        width: 3rem;
        height: 3rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    /* 모바일에서 입력 필드 터치 최적화 */
    input, select, textarea, button {
        font-size: 16px; /* iOS에서 자동 확대 방지 */
    }
    
    /* 모바일에서 검색 컨테이너 최적화 */
    .search-container {
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    /* 모바일에서 알림 위치 조정 */
    .notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: auto;
        text-align: center;
    }
}

/* 작은 모바일 화면 최적화 */
@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
    
    .tool-card {
        border-radius: 0.75rem;
    }
    
    .tool-card-content {
        padding: 1.25rem;
    }
    
    /* 작은 화면에서 버튼 크기 최적화 */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 작은 화면에서 도구 상세 페이지 최적화 */
    .tool-details {
        padding: 1rem;
        margin: 0.25rem;
    }
}

/* 태블릿 최적화 */
@media (min-width: 769px) and (max-width: 1024px) {
    .tools-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .main-content {
        margin-left: 16rem;
    }
    
    .sidebar {
        width: 16rem;
    }
}

/* 터치 디바이스 최적화 */
@media (hover: none) {
    /* 터치 영역 확대 */
    .sidebar-nav-item,
    .tool-card,
    .btn,
    .favorite-btn {
        min-height: 44px; /* 터치 영역 최소 크기 */
    }
    
    /* 터치 피드백 효과 */
    .tool-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    /* 스크롤 개선 */
    .tools-container,
    .sidebar-nav {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* 다크 모드 최적화 */
.dark .sidebar-toggle {
    color: var(--neutral-200);
}

.dark .overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

/* 사이드바 오버레이 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.overlay.active {
    display: block;
}

/* 접근성 관련 스타일 */
.skip-navigation {
    position: absolute;
    top: -40px;
    left: 0;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    padding: 0.75rem 1rem;
    z-index: 2000;
    transition: top 0.3s;
    border-radius: 0 0 0.5rem 0;
}

.skip-navigation:focus-within {
    top: 0;
}

.skip-navigation a {
    color: white;
    text-decoration: none;
}

/* 화면 방향 변경 대응 */
@media (orientation: landscape) and (max-width: 768px) {
    .tools-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}

/* 애니메이션 최적화 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
} 