/* Custom styles for the price scraper application */

body {
    min-height: 100vh;
    background: var(--bs-dark);
}

.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.price-item {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease-in-out;
    background: var(--bs-body-bg);
}

.price-item:hover {
    border-color: var(--bs-info);
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.price-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-success);
    font-family: 'Courier New', monospace;
}

.price-context {
    font-size: 0.9rem;
    color: var(--bs-secondary);
    line-height: 1.4;
    overflow-wrap: break-word;
}

.input-group-text {
    background-color: var(--bs-secondary-bg);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.text-break {
    word-break: break-all;
}

/* 분석 중 카드 스타일 */
.analyzing-card {
    min-height: auto !important;
}

.analyzing-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

/* 검색창리스트 결과 카드 스타일 */
.search-result-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease-in-out;
    background: var(--bs-body-bg);
    height: auto;
    min-height: 80px;
}

.search-result-card:hover {
    border-color: var(--bs-info);
    transform: translateY(-1px);
    box-shadow: 0 0.15rem 0.3rem rgba(0, 0, 0, 0.1);
}

.search-result-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-info);
    font-family: 'Courier New', monospace;
}

.search-result-name {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    margin-bottom: 0;
}

.search-result-discount {
    font-size: 0.75rem;
    font-weight: 600;
}

.card-result-discount {
    font-size: 0.9rem;
    font-weight: 600;
}

/* 카드리스트 결과 카드 스타일 수정 */
.card-result-item {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease-in-out;
    background: var(--bs-body-bg);
    height: auto;
}

.card-result-item:hover {
    border-color: var(--bs-success);
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card-result-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-success);
    font-family: 'Courier New', monospace;
}

.card-result-name {
    font-size: 0.9rem;
    color: var(--bs-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .price-item {
        padding: 0.75rem;
    }
    
    .price-value {
        font-size: 1.1rem;
    }
}

/* Animation for results appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Loading pulse effect */
.loading-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* URL Input 필드 최적화 */
#urlInput {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    overflow-x: auto;
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

/* URL 입력을 위한 반응형 개선 */
@media (max-width: 768px) {
    #urlInput {
        font-size: 13px;
        min-width: 0;
    }
    
    .input-group .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .input-group {
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .input-group-text {
        flex-shrink: 0;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
}

/* 매우 작은 화면에서 추가 최적화 */
@media (max-width: 576px) {
    #urlInput {
        font-size: 12px;
    }
    
    .btn {
        font-size: 13px;
        padding: 0.5rem 0.75rem;
    }
    
    .input-group-text {
        padding: 0.5rem;
    }
}

/* 역동적 제목 폰트 */
.dynamic-title {
    font-family: 'Black Han Sans', sans-serif !important;
    font-size: 2.1rem !important;
    font-weight: normal !important;
    letter-spacing: 0.5px !important;
    color: #20b2aa !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 1rem !important;
}

/* 서브타이틀 설명 */
.subtitle-description {
    margin-bottom: 1.5rem !important;
}

.subtitle-description p {
    color: #ffffff !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    opacity: 0.9 !important;
}

/* 로고 스타일 */
.logo-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 매직 그라데이션 테마 */
:root {
    --magic-gold: #ffd700;
    --magic-teal: #20b2aa;
    --magic-purple: #9370db;
    --magic-gradient: linear-gradient(135deg, #ffd700 0%, #20b2aa 50%, #9370db 100%);
}

/* 할인율 강조 스타일 */
.search-result-discount-big, .card-result-discount-big {
    font-size: 1.4rem !important;
    font-weight: bold !important;
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.3rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 할인율 색상 적용 */
.discount-positive {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.discount-negative {
    background: linear-gradient(135deg, #dc3545, #e74c3c) !important;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

/* 검색 결과 카드 할인율 특별 크기 */
.search-result-discount-big {
    font-size: 1.1rem !important;
    padding: 0.3rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 카드 결과 할인율 더 큰 크기 */
.card-result-discount-big {
    font-size: 1.3rem !important;
    padding: 0.4rem;
    color: rgba(255, 255, 255, 0.9);
}


/* 최저가 할인율 강조 스타일 */
.lowest-price-discount {
    font-size: 1.3rem !important;
    font-weight: bold !important;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    display: inline-block;
}

/* 최저가 할인율 색상 강제 적용 */
/*
.lowest-price-discount.discount-positive,
.lowest-price-discount.discount-negative,
.lowest-price-discount.discount-neutral {
    color: white !important;
}
*/

.discount-neutral {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
}

/* 전체 테마 색상 오버라이드 */
.btn-info {
    background: var(--magic-gradient) !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.progress-bar.bg-info {
    background: var(--magic-gradient) !important;
}

.text-info {
    background: var(--magic-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.badge.bg-primary {
    background: var(--magic-gradient) !important;
    border: none !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #20b2aa 0%, #17a2b8 100%) !important;
}

.card-header.bg-success {
    background: var(--magic-gradient) !important;
    border: none !important;
}

.border-success {
    border-color: var(--magic-teal) !important;
}

/* 진행바 중앙 정렬 */
.progress {
    max-width: 400px;
    margin: 0 auto !important;
    height: 12px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    border-radius: 10px;
    background: var(--magic-gradient);
    background-size: 200% 200%;
    animation: magicShimmer 2s ease-in-out infinite;
}

@keyframes magicShimmer {
    0% { background-position: 200% 200%; }
    50% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

/* 카드 스타일 개선 - 기존 스타일 오버라이드 */
.card {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.15) !important;
}

/* 입력 필드 스타일 */
.form-control:focus {
    border-color: var(--magic-teal) !important;
    box-shadow: 0 0 0 0.2rem rgba(32, 178, 170, 0.25) !important;
}

/* 창열기 버튼 스타일 */
.btn-success {
    background: var(--magic-gradient) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.4);
}

.btn-outline-primary {
    border-color: var(--magic-teal) !important;
    color: var(--magic-teal) !important;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: var(--magic-gradient) !important;
    border-color: transparent !important;
    color: white !important;
    transform: translateY(-2px);
}

/* 반응형 로고 */
@media (max-width: 768px) {
    .logo-image {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .logo-image {
        height: 120px;
    }
}

/* 최저가 할인율 스타일 */
.lowest-price-discount {
    font-size: 1rem;
    font-weight: bold;
}

/* 최저가 카드 빛나는 효과 - 검색창리스트 */
.search-result-card.lowest-price {
    border: 3px solid var(--magic-gold) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 
                0 0 40px rgba(255, 215, 0, 0.4), 
                0 0 60px rgba(255, 215, 0, 0.2) !important;
    animation: glowPulse 2s ease-in-out infinite alternate !important;
    transform: scale(1.02) !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(32, 178, 170, 0.1)) !important;
}

/* 최저가 카드 빛나는 효과 - 카드리스트 */
.card-result-item.lowest-price {
    border: 3px solid var(--magic-gold) !important;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 
                0 0 50px rgba(255, 215, 0, 0.5), 
                0 0 75px rgba(255, 215, 0, 0.3) !important;
    animation: glowPulse 2s ease-in-out infinite alternate !important;
    transform: scale(1.03) !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(32, 178, 170, 0.1)) !important;
}

/* 빛나는 애니메이션 */
@keyframes glowPulse {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 
                    0 0 40px rgba(255, 215, 0, 0.4), 
                    0 0 60px rgba(255, 215, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 
                    0 0 60px rgba(255, 215, 0, 0.6), 
                    0 0 90px rgba(255, 215, 0, 0.4);
    }
}

/* 최저가 카드 호버 효과 비활성화 (빛나는 효과 유지) */
.search-result-card.lowest-price:hover,
.card-result-item.lowest-price:hover {
    transform: scale(1.05) !important;
}
