/* ===== Search Enhanced Styles ===== */

/* 메인 컨테이너 */
.search-main-container {
    padding: 0;
    background: white;
     margin: 0 200px;
}

/* 섹션 타이틀 */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 30px;
    border-left: 4px solid #3b82f6;
    padding-left: 16px;
    margin-top: 30px;
}

/* 검색 폼 영역 */
.search-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-label {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
    font-size: 16px;
}

.info-alert {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.info-alert-header {
    color: #1d4ed8;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.info-alert-content {
    color: #1e40af;
    font-size: 13px;
    line-height: 1.5;
}

.search-row {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
}

.search-input-wrapper {
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(0);
}

.search-options {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
}

.radio-option input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.radio-option label {
    font-size: 14px;
    margin: 0;
    cursor: pointer;
    color: #374151;
}

.filter-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.checkbox-option label {
    font-size: 14px;
    margin: 0;
    cursor: pointer;
    color: #374151;
}

/* 결과 영역 */
.results-section {
    margin-top: 20px;
}

.results-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #3b82f6;
    border-radius: 2px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.search-tech-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}


.search-tech-card:hover {
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.15);
    transform: translateY(-6px);
    border-color: #3b82f6;
}

.search-tech-card:hover .card-header {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.search-tech-card:hover .card-category,
.search-tech-card:hover .card-date {
    color: white;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.card-category {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.card-date {
    font-size: 12px;
    color: #6b7280;
    transition: all 0.3s ease;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    margin: 0;
    padding: 20px 20px 12px;
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.search-tech-card:hover .card-title {
    color: #3b82f6;
}

.card-organization {
    font-size: 13px;
    color: #6b7280;
    padding: 0 20px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-organization i {
    font-size: 14px;
    color: #9ca3af;
}

.card-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0 20px;
}

.card-stats {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 16px;
    margin-top: auto;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    position: relative;
    border: 1px solid transparent;
    min-width: 0;
    font-weight: 600;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-item-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.stat-item i {
    font-size: 14px;
    transition: all 0.2s ease;
}

.stat-item-label {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    display: none; /* 기본적으로 숨김 */
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

/* 조회수 스타일 */
.stat-item.stat-views {
    background: #3b82f6;
    color: white;
}

.stat-item.stat-views:hover {
    background: #2563eb;
}

.stat-item.stat-views i {
    color: white;
}

.stat-item.stat-views .stat-item-label,
.stat-item.stat-views .stat-value {
    color: white;
}

/* 상담수 스타일 */
.stat-item.stat-consult {
    background: #10b981;
    color: white;
}

.stat-item.stat-consult:hover {
    background: #059669;
}

.stat-item.stat-consult i {
    color: white;
}

.stat-item.stat-consult .stat-item-label,
.stat-item.stat-consult .stat-value {
    color: white;
}

/* 찜하기 스타일 */
.stat-item.stat-favorite {
    background: #6b7280;
    color: white;
}

.stat-item.stat-favorite:hover {
    background: #4b5563;
}

.stat-item.stat-favorite i {
    color: white;
}

.stat-item.stat-favorite .stat-item-label,
.stat-item.stat-favorite .stat-value {
    color: white;
}

/* 찜하기 활성화 상태 */
.stat-item.favorited {
    background: #ef4444;
    color: white;
}

.stat-item.favorited:hover {
    background: #dc2626;
}

.stat-item.favorited i {
    color: white;
}

.stat-item.favorited .stat-value {
    color: white;
    font-weight: 800;
}

/* 큰 화면에서는 라벨 표시 */
@media (min-width: 1200px) {
    .stat-item {
        padding: 10px 16px;
    }
    
    .stat-item-label {
        display: inline;
    }
    
    .stat-item-left {
        gap: 6px;
    }
}

/* 페이지네이션 */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.pagination li {
    margin: 0;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #374151;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
    padding: 0 8px;
}

.pagination a:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.pagination .active a {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* 로딩 */
.loading-container {
    text-align: center;
    padding: 40px 0;
    color: #6b7280;
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
}

/* 에러/빈 결과 */
.no-results,
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

.error-message {
    color: #ef4444;
}

.error-message i {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

/* 토스트 메시지 */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #374151;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #10b981;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    max-width: 300px;
}

.toast-message.show {
    transform: translateX(0);
}

.toast-message.toast-error {
    border-left-color: #ef4444;
}

.toast-message.toast-info {
    border-left-color: #3b82f6;
}

.toast-message i {
    font-size: 16px;
    color: #10b981;
}

.toast-message.toast-error i {
    color: #ef4444;
}

.toast-message.toast-info i {
    color: #3b82f6;
}

/* 스켈레톤 로딩 */
.tech-card-skeleton {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-title {
    height: 20px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-meta {
    height: 40px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 16px;
}

.skeleton-stats {
    height: 16px;
    background: #e5e7eb;
    border-radius: 4px;
    width: 80%;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 반응형 */
/* 대형 화면 (1920px+) */
@media (min-width: 1920px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 28px;
    }
}

/* 일반 데스크탑 */
@media (max-width: 1500px) {
    .search-main-container {
        margin: 0 100px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .search-main-container {
        margin: 0 80px;
    }
    
    .card-title {
        font-size: 15px;
        padding: 16px 16px 10px;
    }
    
    .card-stats {
        padding: 12px 16px;
    }
}

    @media (max-width: 768px) {
        .search-row {
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
        }

        .search-btn {
            width: 100%;
            justify-content: center;
        }

        .search-options,
        .filter-options {
            flex-direction: column;
            gap: 12px;
        }

        .cards-grid {
            grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
            gap: 16px;
        }
        
        .card-header {
            padding: 12px 16px;
        }
        
        .card-category {
            font-size: 11px;
            padding: 3px 10px;
        }
        
        .card-date {
            font-size: 11px;
        }
        
        .card-title {
            font-size: 14px;
            padding: 16px 16px 8px;
            min-height: 50px;
        }
        
        .card-organization {
            font-size: 12px;
            padding: 0 16px 12px;
        }
        
        .card-stats {
            padding: 12px;
            gap: 6px;
        }
        
        .stat-item {
            padding: 6px 8px;
            flex-direction: column;
            gap: 2px;
        }
        
        .stat-item i {
            font-size: 16px;
        }
        
        .stat-item-label {
            display: none; /* 모바일에서는 라벨 숨김 */
        }
        
        .stat-value {
            font-size: 11px;
        }

        .pagination {
            flex-wrap: wrap;
            gap: 2px;
        }

            .pagination a {
                min-width: 32px;
                height: 32px;
                font-size: 12px;
            }

        .toast-message {
            right: 10px;
            left: 10px;
            max-width: none;
            transform: translateY(-100%);
        }

            .toast-message.show {
                transform: translateY(0);
            }

        .search-main-container {
            margin: 0 40px;
        }
    }

    @media (max-width: 480px) {

        .search-main-container {
            margin: 0 0px;
        }

        .search-container {
            padding: 20px;
            margin: 0 -10px 20px -10px;
        }

        .cards-grid {
            grid-template-columns: 1fr;
            gap: 12px;
        }

        .search-tech-card {
            padding: 16px;
        }

        .section-title {
            font-size: 18px;
            margin-bottom: 20px;
        }

        .results-title {
            font-size: 16px;
            margin-bottom: 20px;
        }
    }

    /* 인터랙션 개선 */
    .search-input:focus + .search-btn,
    .search-input:valid + .search-btn {
        background: #2563eb;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    .search-tech-card:active {
        transform: translateY(-2px);
    }

    .stat-item:active {
        transform: scale(0.95);
    }

    /* 접근성 개선 */
    .search-btn:focus,
    .search-tech-card:focus,
    .pagination a:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }

    .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;
    }
