/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceSubtle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* CustomImage Component Styles */
.custom-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.custom-image-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.custom-image {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
}

.custom-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    text-align: center;
}

.custom-image-container:hover .custom-image-overlay {
    opacity: 1;
}

.custom-image-container:hover .custom-image {
    filter: brightness(0.7);
}

.custom-image-description {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 90%;
    font-weight: 500;
}

@media (max-width: 768px) {
    .custom-image-description {
        font-size: 0.85rem;
    }
    
    .custom-image-overlay {
        padding: 0.75rem;
    }
}

/* Post Component Styles - Updated to match index.html cards */
.post-container {
    margin: 1.5rem 0;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1rem;
    position: relative;
}

/* Single post card without container background */
.post-card:only-child {
    margin: 1.5rem 0;
}

/* Hover and touch interactions */
.post-card:hover,
.post-card:focus,
.post-card:active {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* Group hover effect - when one card is hovered, all cards in the same container expand */
.post-container:hover .post-card.portfolio,
.post-slider:hover .post-card.portfolio {
    height: 250px;
}

.post-container:hover .post-card.tech,
.post-slider:hover .post-card.tech {
    height: 235px;
}

/* Single card hover for cards outside containers */
.post-card:only-child.portfolio:hover {
    height: 250px;
}

.post-card:only-child.tech:hover {
    height: 235px;
}

/* Mobile touch support */
@media (hover: none) and (pointer: coarse) {
    .post-container:active .post-card.portfolio,
    .post-slider:active .post-card.portfolio {
        height: 230px;
        transition-duration: 0.2s;
    }
    
    .post-container:active .post-card.tech,
    .post-slider:active .post-card.tech {
        height: 220px;
        transition-duration: 0.2s;
    }
    
    .post-card:only-child.portfolio:active {
        height: 230px;
        transition-duration: 0.2s;
    }
    
    .post-card:only-child.tech:active {
        height: 220px;
        transition-duration: 0.2s;
    }
}

.post-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
}

.post-slider::-webkit-scrollbar {
    display: none;
}

.post-card {
    flex-shrink: 0;
    width: 300px;
    height: 120px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
}

.post-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* Portfolio card styling */
.post-card.portfolio .post-card-image {
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.post-card.portfolio .post-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.post-card.portfolio:hover .post-card-image::before {
    background: rgba(0, 0, 0, 0.05);
}

/* Tech post card styling */
.post-card.tech .post-card-image {
    height: 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    position: relative;
}

.post-card.tech .post-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.post-card.tech:hover .post-card-image::before {
    background: rgba(0, 0, 0, 0.05);
}

.post-card-content {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.post-card:hover .post-card-content {
    padding: 1rem;
}

.post-card-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: #1a202c;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.post-card:hover .post-card-title {
    color: #3b82f6;
    -webkit-line-clamp: 2;
}

.post-card-description {
    font-size: 0.75rem;
    color: #718096;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.post-card:hover .post-card-description {
    -webkit-line-clamp: 4;
    margin-bottom: 0.75rem;
}

/* Group hover effects for content expansion */
.post-container:hover .post-card-title,
.post-slider:hover .post-card-title {
    -webkit-line-clamp: 2;
}

.post-card:only-child:hover .post-card-title {
    -webkit-line-clamp: 2;
}

.post-container:hover .post-card-description,
.post-slider:hover .post-card-description {
    -webkit-line-clamp: 4;
    margin-bottom: 0.75rem;
}

.post-card:only-child:hover .post-card-description {
    -webkit-line-clamp: 4;
    margin-bottom: 0.75rem;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

/* Group hover effects for card expansion and tags */
.post-container:hover .post-card-tags,
.post-slider:hover .post-card-tags {
    opacity: 1;
    max-height: 80px;
}

.post-card:only-child:hover .post-card-tags {
    opacity: 1;
    max-height: 80px;
}

.post-card-tag {
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.post-card-type {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    transition: all 0.3s ease;
}

.post-card.portfolio .post-card-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.post-card.tech .post-card-type {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.post-card:hover .post-card-type {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.post-card-meta {
    font-size: 0.625rem;
    color: #9ca3af;
    font-weight: 500;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.post-card:hover .post-card-meta {
    opacity: 1;
    max-height: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-card {
        width: 280px;
        height: 120px;
    }
    
    .post-card.portfolio:hover {
        height: 230px;
    }
    
    .post-card.tech:hover {
        height: 220px;
    }
    
    .post-card-title {
        font-size: 0.625rem;
    }
    
    .post-card-description {
        font-size: 0.7rem;
    }
}

/* Scroll indicators - removed animations */
.post-container::before,
.post-container::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(59, 130, 246, 0.2));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.post-container::before {
    left: 10px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(59, 130, 246, 0.2));
}

.post-container::after {
    right: 10px;
    background: linear-gradient(270deg, rgba(59, 130, 246, 0.8), rgba(59, 130, 246, 0.2));
}

.post-container:hover::before,
.post-container:hover::after {
    opacity: 1;
}

/* Loading animation for post cards */
.post-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Responsive adjustments - 중복 제거 */
@media (max-width: 768px) {
    .post-card {
        width: 280px;
        height: 120px;
    }
    
    .post-card.portfolio:hover {
        height: 220px;
    }
    
    .post-card.tech:hover {
        height: 210px;
    }
    
    .post-card-title {
        font-size: 0.625rem;        #modal-related-portfolios h3 {
          font-size: 0.75rem !important;
          font-weight: 500 !important;
        }
        @media (max-width: 768px) {
          #modal-related-portfolios h3 {
            font-size: 0.625rem !important;
          }
        }
    }
    
    .post-card-description {
        font-size: 0.7rem;
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Scroll smooth */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Portfolio card hover effects */
.portfolio-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.portfolio-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.05);
}

.portfolio-image {
    transition: transform 0.4s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Line clamp utilities */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Portfolio card group animations */
.portfolio-card .tech-tag {
    transition: all 0.3s ease;
}

.portfolio-card:hover .tech-tag {
    transform: translateY(-2px);
}

/* Suggestion item animations */
.suggestion-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-item:hover {
    background-color: #f8fafc;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-item:hover {
    background-color: #f8fafc;
    transform: translateX(4px);
}

/* AI Response typing effect */
.typing-effect {
    border-right: 2px solid #3b82f6;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #3b82f6;
    }
}

/* Modal animations */
.modal-backdrop {
    transition: opacity 0.3s ease-out;
}

.modal-backdrop.modal-entering {
    opacity: 0;
}

.modal-backdrop.modal-entered {
    opacity: 1;
}

.modal-backdrop.modal-exiting {
    opacity: 0;
}

.modal-container {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-container.modal-entering {
    opacity: 0;
    transform: scale(0.7) translateY(50px);
}

.modal-container.modal-entered {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.modal-container.modal-exiting {
    opacity: 0;
    transform: scale(0.8) translateY(-30px);
}

.modal-content {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-content.modal-entering {
    opacity: 0;
    transform: translateY(30px);
}

.modal-content.modal-entered {
    opacity: 1;
    transform: translateY(0);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(60px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* Tech tags */
.tech-tag {
    transition: all 0.2s ease;
}

.tech-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

@keyframes loadingDots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: #3b82f6;
        text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow: 0.25em 0 0 #3b82f6, 0.5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow: 0.25em 0 0 #3b82f6, 0.5em 0 0 #3b82f6;
    }
}

/* Responsive grid */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) and (max-width: 1440px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        padding: 0 2rem;
    }
}

@media (min-width: 1440px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
        padding: 0 2.5rem;
    }
}

/* Navigation shadow on scroll */
.nav-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* AI Comment bubbles */
.ai-comment {
    animation: commentSlideIn 0.5s ease-out;
}

@keyframes commentSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Source links hover */
.source-link {
    transition: all 0.2s ease;
}

.source-link:hover {
    background-color: #f0f9ff;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* Pulse animation for AI status */
.pulse-green {
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Portfolio grid responsive animations */
@media (max-width: 768px) {
    .portfolio-card {
        transform: none;
    }
    
    .portfolio-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    }
}

/* Fade in up animation for portfolio cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animation delays */
.portfolio-card:nth-child(1) { animation-delay: 0.1s; }
.portfolio-card:nth-child(2) { animation-delay: 0.2s; }
.portfolio-card:nth-child(3) { animation-delay: 0.3s; }
.portfolio-card:nth-child(4) { animation-delay: 0.4s; }
.portfolio-card:nth-child(5) { animation-delay: 0.5s; }
.portfolio-card:nth-child(6) { animation-delay: 0.6s; }
.portfolio-card:nth-child(7) { animation-delay: 0.7s; }
.portfolio-card:nth-child(8) { animation-delay: 0.8s; }
.portfolio-card:nth-child(n+9) { animation-delay: 0.9s; }

/* Gradient animations for portfolio images */
.portfolio-image {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

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

.portfolio-card:hover .portfolio-image {
    animation-duration: 3s;
}

/* Tech tag hover glow effect */
.tech-tag {
    position: relative;
    overflow: hidden;
}

.tech-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.portfolio-card:hover .tech-tag::before {
    left: 100%;
}

/* Portfolio Modal Responsive Design */
#portfolio-modal {
    backdrop-filter: blur(4px);
}

#portfolio-modal .h-full {
    height: 100vh;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    #portfolio-modal .lg\\:flex-row .flex-1 {
        display: flex;
        flex: 1;
        min-height: 0;
    }
    
    #portfolio-modal .lg\\:w-96 {
        width: 24rem;
        flex-shrink: 0;
        height: 100%;
    }
}

/* Mobile and Tablet Layout */
@media (max-width: 1023px) {
    #portfolio-modal .flex-col {
        height: 100vh;
    }
    
    #portfolio-modal .flex-1 {
        flex: 1;
        min-height: 0;
    }
    
    #portfolio-modal .lg\\:w-96 {
        width: 100%;
        max-height: 35vh;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 768px) {
    #portfolio-modal .p-4 {
        padding: 1rem;
    }
    
    #portfolio-modal .md\\:p-6 {
        padding: 1rem;
    }
    
    #portfolio-modal .lg\\:p-8 {
        padding: 1rem;
    }
    
    #portfolio-modal .lg\\:w-96 {
        max-height: 40vh;
    }
}

/* Ensure content is visible on all screen sizes */
#portfolio-modal .flex-1.overflow-y-auto {
    min-height: 200px;
}

/* Modal Header Shadow */
#portfolio-modal .border-b {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Sidebar Scroll Enhancement */
#portfolio-modal .lg\\:w-96 .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#portfolio-modal .lg\\:w-96 .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

#portfolio-modal .lg\\:w-96 .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#portfolio-modal .lg\\:w-96 .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Modal Content Animations */
#portfolio-modal .ai-comment {
    animation: slideInUp 0.4s ease-out forwards;
}

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

/* Related Portfolio Cards */
#modal-related-portfolios .cursor-pointer:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modal Search Input Focus */
#modal-search-input:focus {
    background-color: #fefefe;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Sidebar Toggle */
#mobile-sidebar-toggle {
    position: relative;
}

#mobile-sidebar-toggle::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Floating button hover effects */
#mobile-sidebar-toggle:hover {
    transform: scale(1.1);
}

#mobile-sidebar-toggle:active {
    transform: scale(0.95);
}

/* Mobile Sidebar Overlay */
@media (max-width: 1023px) {
    #modal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        align-items: flex-end;
    }
    
    #modal-sidebar.show {
        transform: translateY(0);
    }
    
    #modal-sidebar > div {
        background: white;
        width: 100%;
        height: 65vh; /* 고정 높이로 변경 */
        max-height: 65vh;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        position: relative;
        overflow: hidden;
    }
    
    /* Slide up animation for mobile sidebar content */
    #modal-sidebar.show .p-4 {
        animation: slideUpContent 0.3s ease-out 0.1s both;
    }
}

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

/* Mobile sidebar handle indicator */
@media (max-width: 1023px) {
    #modal-sidebar > div::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
        z-index: 10;
    }
    
    #modal-sidebar .p-4 {
        padding-top: 2rem;
        height: 100%;
        overflow-y: auto;
    }
}

/* Floating button positioning fix */
@media (max-width: 1023px) {
    #mobile-sidebar-toggle {
        position: fixed !important;
        bottom: 24px !important;
        right: 24px !important;
        z-index: 70 !important; /* 사이드바보다 위에 */
        margin: 0 !important;
    }
}

/* Floating button animation when active */
#mobile-sidebar-toggle.active {
    background: #dc2626 !important;
}

#mobile-sidebar-toggle.active i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

#mobile-sidebar-toggle.active::after {
    display: none;
}

/* Search History Styles */
.search-history-item {
    transition: all 0.3s ease;
}

.search-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-history-item .repeat-search-btn {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.search-history-item:hover .repeat-search-btn {
    opacity: 1;
    transform: translateX(0);
}

.repeat-search-btn:hover {
    background-color: #dbeafe;
    transform: scale(1.05);
}

/* Chat bubble animations */
.search-history-item .bg-blue-50 {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    position: relative;
}

.search-history-item .bg-blue-50::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #dbeafe;
}

.search-history-item .bg-white::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ffffff;
    filter: drop-shadow(-1px 0 0 #e5e7eb);
}

/* Search history container animations */
#search-history-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

#search-history-container:not(.hidden) {
    max-height: 2000px;
}

/* Error message styles */
.error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Search Results Card Styles */
.search-results-container {
    margin: 1.5rem 0;
}

.search-results-header {
    margin-bottom: 1rem;
}

.search-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.search-slider-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.search-slider-wrapper::-webkit-scrollbar {
    height: 8px;
}

.search-slider-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.search-slider-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.search-slider-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.search-slider {
    display: flex;
    gap: 20px;
    padding: 10px;
    scroll-behavior: smooth;
}

.search-result-card {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.search-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-result-card .card-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.content-type-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-type-badge.portfolio {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.content-type-badge.tech_post {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.search-result-card .card-body {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.content-preview {
    padding: 30px 8px 40px 8px;
    font-size: 10px;
    line-height: 1.3;
    color: #6b7280;
    height: 100%;
    overflow: hidden;
    position: relative;
    opacity: 0.7;
    transform: scale(0.9);
    transform-origin: top left;
}

.content-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.content-preview h1, .content-preview h2, .content-preview h3 {
    font-weight: 600;
    margin: 6px 0 3px 0;
    color: #4b5563;
}

.content-preview h1 { font-size: 12px; }
.content-preview h2 { font-size: 11px; }
.content-preview h3 { font-size: 10px; }

.content-preview p {
    margin-bottom: 6px;
}

.content-preview ul, .content-preview ol {
    margin: 3px 0;
    padding-left: 12px;
}

.content-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 3px 0;
    opacity: 0.8;
}

.content-preview code {
    background: #f3f4f6;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 8px;
    color: #059669;
}

.content-preview pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 6px;
    border-radius: 3px;
    overflow-x: auto;
    margin: 6px 0;
    font-size: 8px;
}

.search-result-card .card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.expand-btn {
    padding: 4px 8px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 3px;
}

.expand-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.view-source-btn {
    padding: 4px 8px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 3px;
}

.view-source-btn:hover {
    background: #4b5563;
    transform: scale(1.05);
}

/* 슬라이더 컨트롤 제거 */

/* 검색 카드 모달 - 절대좌표 중앙 정렬 */
.search-card-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-card-modal.show {
    opacity: 1;
    visibility: visible;
}

.search-card-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.search-card-modal .modal-content {
    position: relative;
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.search-card-modal.show .modal-content {
    transform: scale(1);
}

.search-card-modal .modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.search-card-modal .close-btn {
    width: 36px;
    height: 36px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.search-card-modal .close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.search-card-modal .modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.search-card-modal .modal-body h1, 
.search-card-modal .modal-body h2, 
.search-card-modal .modal-body h3 {
    font-weight: 600;
    margin: 24px 0 16px 0;
    color: #1f2937;
}

.search-card-modal .modal-body h1 { 
    font-size: 28px; 
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.search-card-modal .modal-body h2 { 
    font-size: 22px; 
    color: #059669;
}

.search-card-modal .modal-body h3 { 
    font-size: 18px; 
}

.search-card-modal .modal-body p {
    margin-bottom: 16px;
    color: #4b5563;
}

.search-card-modal .modal-body ul,
.search-card-modal .modal-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.search-card-modal .modal-body li {
    margin-bottom: 8px;
    color: #4b5563;
}

.search-card-modal .modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-card-modal .modal-body code {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #059669;
    font-family: 'Courier New', monospace;
}

.search-card-modal .modal-body pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.search-card-modal .modal-body blockquote {
    border-left: 4px solid #10b981;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #6b7280;
    background: #f0fdf4;
    padding: 12px 16px;
    border-radius: 4px;
}

.search-card-modal .modal-footer {
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.search-card-modal .modal-footer .view-source-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-card-modal .modal-footer .view-source-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .search-result-card {
        width: 180px;
        height: 180px;
    }
    
    .search-slider {
        gap: 10px;
        padding: 5px;
    }
    
    .content-preview {
        padding: 25px 6px 35px 6px;
        font-size: 9px;
    }
    
    .content-type-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .expand-btn,
    .view-source-btn {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .search-card-modal .modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .search-card-modal .modal-header,
    .search-card-modal .modal-body,
    .search-card-modal .modal-footer {
        padding: 16px;
    }
    
    .search-card-modal .modal-body {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .search-result-card {
        width: 160px;
        height: 160px;
    }
    
    .search-slider {
        gap: 8px;
        padding: 5px;
    }
    
    .content-preview {
        padding: 22px 5px 30px 5px;
        font-size: 8px;
        line-height: 1.2;
    }
    
    .content-type-badge {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    .expand-btn,
    .view-source-btn {
        font-size: 8px;
        padding: 2px 4px;
        gap: 2px;
    }
    
    .search-card-modal .modal-body {
        font-size: 13px;
        padding: 12px;
    }
    
    .search-card-modal .modal-header,
    .search-card-modal .modal-footer {
        padding: 12px;
    }
}
