body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #ffffff;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    transition: background-color 0.3s ease;

}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(248, 250, 252, 0.4) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, #3b82f6 360deg);
    animation: spin 1.5s linear infinite;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.loading-message {
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.025em;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
}

.loading-message::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 2px;
    animation: expand 2s ease-in-out infinite;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes expand {
    0%, 100% {
        width: 40px;
        opacity: 1;
    }
    50% {
        width: 60px;
        opacity: 0.7;
    }
}

.dark .loading-overlay {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(30, 41, 59, 0.4) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .loading-spinner {
    background: conic-gradient(from 0deg, transparent 0deg, #60a5fa 360deg);
    box-shadow: 0 8px 32px rgba(96, 165, 250, 0.4);
}

.dark .loading-spinner::before {
    background: #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark .loading-spinner::after {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark .loading-message {
    color: #f1f5f9;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .loading-message::after {
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}

/* 테마 로딩 중 스타일 */
.theme-loading {
    visibility: hidden;
}

.store-logo {
    width:70px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px;
    cursor: move;
    user-select: none;
}

.store-logo img {
    width: 100%;
}

.product-card {
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.cashback-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

@media (max-width: 380px) {
    body{
        min-width:380px;
        overflow-x: auto;
    }
        
}

@media (max-width: 768px) {
    #searchResult {
        max-width: calc(100vw - 2em);
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        opacity: 0;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
        z-index: 1001;
    }
    
    .sidebar.active {
        transform: translateX(0);
        opacity: 1;
    }
    
    .overlay {
        display: none;
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        top: 0;
        left: 0;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }
    
    .overlay.active {
        display: block;
        opacity: 1;
    }
}

@media (min-width: 769px) {
    #searchResult {
        max-width: calc(65vw - 2rem);
    }
    .sidebar {
        transform: none;
        opacity: 1;
    }
    .overlay {
        display: none !important;
    }
}

.menu-item {
    transition: all 0.3s ease;
}

.menu-item:hover, .menu-item.active {
    background-color: #f1f5f9;
    color: #3b82f6;
}

.submenu-item {
    transition: all 0.3s ease;
}

.submenu-item:hover, .submenu-item.active {
    background-color: #f1f5f9;
    color: #3b82f6;
}

.dark .submenu-item:hover, .dark .submenu-item.active {
    background-color: #2d3748;
    color: #60a5fa;
}

.recommendation-section {
    border-radius: 15px;
    background-color: white;
    border: 1px solid #edf2f7;
}

.settings-button {
    position: absolute;
    bottom: 20px;
    left: 20px;
    transition: all 0.3s ease;
}

.settings-button:hover {
    color: #3b82f6;
}

.input-container {
    background-color: white;
    border-top: 1px solid #edf2f7;
    padding: 1rem;
    margin-top: 2rem;
}

.product-title {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.5em;
    line-height: 1.25em;
}

/* Dark mode styles */
.dark {
    --bg-color: #1a1b2e;
    --text-color: #e2e8f0;
    --border-color: #2d3748;
}

.dark body {
    background-color: #1a1b2e;
    color: #e2e8f0;
}

.dark .sidebar {
    background-color: var(--bg-color);
    border-right: none;
}

.dark .menu-item {
    color: var(--text-color);
}

.dark .menu-item:hover, .dark .menu-item.active {
    background-color: #2d3748;
    color: #60a5fa;
}

.dark .recommendation-section {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
}

.dark input, .dark textarea {
    background-color: #2d3748;
    color: var(--text-color);
    border-color: var(--border-color);
}

.dark .product-card {
    background-color: var(--bg-color);
}

.dark .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.dark .product-card .text-gray-500 {
    color: #a0aec0 !important;
}

.dark .product-card .text-sm {
    color: var(--text-color) !important;
}

.dark .product-card .text-blue-500 {
    color: #60a5fa !important;
}

.dark .product-card .bg-blue-50 {
    background-color: #2d3748 !important;
}

.dark .bg-gray-100 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

.dark .bg-gray-100:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

.dark .bg-yellow-100 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

.dark .bg-yellow-100:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

.dark .bg-blue-100 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

.dark .bg-blue-100:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

.dark .text-blue-600 {
    color: #60a5fa !important;
}

.dark .text-red-500 {
    color: #f87171 !important;
}

.dark .text-black-500 {
    color: #e2e8f0 !important;
}

.dark .text-gray-500 {
    color: #a0aec0 !important;
}

.dark .text-white {
    color: #e2e8f0 !important;
}

.dark .bg-white {
    background-color: #1a1b2e !important;
}

.dark .border {
    border-color: var(--border-color) !important;
}

.dark .shadow-sm {
    box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

.dark .cashback-badge {
    background-color: rgba(45, 55, 72, 0.9);
    color: var(--text-color);
}

.dark .bg-gray-200 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

.dark .store-logo img {
    background-color: white;
    padding: 0px;
}

.dark header {
    background-color: var(--bg-color);
    border-bottom: none;
}

.dark .chat-container {
    scrollbar-color: #4a5568 #2d3748;
}

.dark .chat-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark .chat-container::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 4px;
}

.dark .chat-container::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

.dark .chat-container::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.dark .products-container {
    scrollbar-color: #4a5568 transparent;
}

.dark .products-container::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.dark .products-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 2px;
}

.dark .products-container::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 2px;
}

.dark .products-container::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;

        height: 100vh !important;
        min-height: 100vh !important;
    
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 1001;
}

.sidebar.active {
    transform: translateX(0);
    opacity: 1;
}

.overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.overlay.active {
    display: block;
    opacity: 1;
}

@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
        opacity: 1;
    }
    
    .overlay {
        display: none !important;
    }
}

/* 스크롤바 스타일 */
.overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* 다크 모드 스크롤바 스타일 */
.dark .overflow-y-auto {
    scrollbar-color: #4a5568 transparent;
}

.dark .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

.dark .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #4a5568;
}

.dark .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* 작은 화면에서 스크롤바 숨기기 */
@media (max-width: 768px) {
    .overflow-y-auto {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .overflow-y-auto::-webkit-scrollbar {
        display: none;
    }
    

}

.recent-product-item {
    transition: all 0.2s ease;
}

.recent-product-item:hover {
    background-color: #f1f5f9;
}

.dark .recent-product-item:hover {
    background-color: #2d3748;
}

.dark .text-sm.inline-block.bg-blue-500 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--border-color);
}

.dark .text-sm.inline-block.bg-blue-500:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

.dark .text-sm.inline-block.bg-blue-600 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--border-color);
}

.dark .text-sm.inline-block.bg-blue-600:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

.dark .text-sm.inline-block.bg-blue-800 {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--border-color);
}

.dark .text-sm.inline-block.bg-blue-800:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

/* 팝업 스타일 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
}

.popup-container {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

@media (max-width: 640px) {
    .popup-container {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .popup-container {
        width: 80%;
        max-width: 600px;
    }
}

@media (min-width: 1025px) {
    .popup-container {
        width: 70%;
        max-width: 700px;
    }
}

.popup-overlay.active .popup-container {
    transform: translateY(0);
}

.popup-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.popup-close:hover {
    color: #1f2937;
}

.popup-content {
    padding: 16px;
    color: #4b5563;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.popup-content::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera */
}

.popup-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.popup-button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.popup-button.primary {
    background-color: #3b82f6;
    color: white;
}

.popup-button.primary:hover {
    background-color: #2563eb;
}

.popup-button.secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

.popup-button.secondary:hover {
    background-color: #e5e7eb;
}

.popup-button.danger {
    background-color: #ef4444;
    color: white;
}

.popup-button.danger:hover {
    background-color: #dc2626;
}

/* 다크 모드 스타일 */
.dark .popup-container {
    background-color: #1f2937;
}

.dark .popup-title {
    color: #f3f4f6;
}

.dark .popup-content {
    color: #d1d5db;
}

.dark .popup-header,
.dark .popup-footer {
    border-color: #374151;
}

.dark .popup-button.secondary {
    background-color: #374151;
    color: #d1d5db;
}

.dark .popup-button.secondary:hover {
    background-color: #4b5563;
}

.dark .live-ticker {
    background-color: #000000 !important;
    color: #e2e8f0 !important;
}

.dark .live-ticker-container {
    background-color: #000000 !important;
    border-color: #1a1a1a !important;
}

/* 클릭 유도 애니메이션 버튼 */
.focusbtn {
    animation: heartbeat 1.5s ease-in-out infinite;
    position: relative;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

.dark .focusbtn {
    animation: heartbeat 1.5s ease-in-out infinite;
}


/* simpAlert 스타일 */
.simp-alert {
    background-color: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: simpAlertSlideIn 0.3s ease-out;
}

.simp-alert p {
    color: #111827;
    font-weight: 500;
    line-height: 1.6;
    font-size: 14px;
}

.simp-alert .simp-alert-close {
    color: #9ca3af;
    transition: all 0.2s ease;
}

.simp-alert .simp-alert-close:hover {
    color: #4b5563;
    transform: scale(1.1);
}

.simp-alert .simp-alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    width: 100%;
    transform-origin: left;
    transition: transform 0.1s linear;
    border-radius: 0 0 16px 16px;
}

.simp-alert .simp-alert-icon {
    animation: simpAlertIconPulse 2s ease-in-out infinite;
}

@keyframes simpAlertSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes simpAlertIconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* 다크 모드 스타일 */
.dark .simp-alert {
    background-color: #1f2937;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.dark .simp-alert p {
    color: #f9fafb !important;
}

.dark .simp-alert .simp-alert-close {
    color: #9ca3af;
}

.dark .simp-alert .simp-alert-close:hover {
    color: #e5e7eb;
    background-color: #374151;
}

.dark .simp-alert .simp-alert-progress {
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .simp-alert {
        margin: 0 8px;
        width: calc(100vw - 16px) !important;
        max-width: none;
        min-height: 80px;
    }
    
    .simp-alert-container {
        bottom: 16px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .simp-alert p {
        font-size: 15px;
        line-height: 1.5;
        padding-right: 8px;
    }
    
    .simp-alert .simp-alert-close {
        padding: 8px !important;
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .simp-alert .simp-alert-icon {
        min-width: 20px;
        min-height: 20px;
    }
    
    .simp-alert .simp-alert-progress {
        height: 4px;
        border-radius: 0 0 16px 16px;
    }
}

/* 태블릿 최적화 */
@media (min-width: 769px) and (max-width: 1024px) {
    .simp-alert {
        width: 480px !important;
        max-width: calc(100vw - 32px);
    }
    
    .simp-alert p {
        font-size: 14px;
    }
}

/* 데스크톱 최적화 */
@media (min-width: 1025px) {
    .simp-alert {
        width: 420px !important;
    }
    
    .simp-alert p {
        font-size: 14px;
    }
}

/* 접근성 개선 */
.simp-alert:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.dark .simp-alert:focus-within {
    outline-color: #60a5fa;
}

/* 성공 타입 포커스 */
.simp-alert.success:focus-within {
    outline-color: #10b981;
}

.dark .simp-alert.success:focus-within {
    outline-color: #34d399;
}

/* 경고 타입 포커스 */
.simp-alert.warning:focus-within {
    outline-color: #f59e0b;
}

.dark .simp-alert.warning:focus-within {
    outline-color: #fbbf24;
}

/* 오류 타입 포커스 */
.simp-alert.error:focus-within {
    outline-color: #ef4444;
}

.dark .simp-alert.error:focus-within {
    outline-color: #f87171;
}

.main-content {
    display: flex;
    min-height: calc(100vh - 150px);
    flex-direction: column;
    overflow-y: auto;
    margin-top: 42px;
    padding-top: 1rem;
}

/* 스크롤바 숨김 스타일 */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* 다크 모드에서 라디오 버튼 선택 상태 스타일 */
.dark input[type="radio"]:checked + div {
    background-color: #3b82f6 !important;
    color: white !important;
}

.dark input[type="radio"] + div:hover {
    background-color: #374151 !important;
}

/* 라이트 모드에서 라디오 버튼 선택 상태 스타일 */
input[type="radio"]:checked + div {
    background-color: #3b82f6 !important;
    color: white !important;
}

input[type="radio"] + div:hover {
    background-color: #f3f4f6 !important;
}

