/* What We Do Section - Keyword Carousel & Pop-ups */

.what-we-do-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--bg-alt) 0%, #E6FFFA 100%);
    overflow: hidden;
}

.what-we-do-section .section-header {
    margin-bottom: 50px;
}

/* Carousel Container */
.keyword-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
}

/* Fade edges */
.keyword-carousel-wrapper::before,
.keyword-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 10;
    pointer-events: none;
}

.keyword-carousel-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-alt), transparent);
}

.keyword-carousel-wrapper::after {
    right: 0;
    background: linear-gradient(to left, #E6FFFA, transparent);
}

/* Carousel Row */
.keyword-carousel-row {
    display: flex;
    width: max-content;
    margin: 16px 0;
}

.keyword-carousel-row.row-1 {
    animation: scrollCarousel 240s linear infinite;
}

.keyword-carousel-row.row-2 {
    animation: scrollCarousel 220s linear infinite reverse;
}

.keyword-carousel-row.row-3 {
    animation: scrollCarousel 280s linear infinite;
}

/* Pause on hover */
.keyword-carousel-wrapper:hover .keyword-carousel-row {
    animation-play-state: paused;
}

@keyframes scrollCarousel {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Keyword Item */
.keyword-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    margin: 0 10px;
    background: var(--bg-white);
    border: 2px solid rgba(13, 148, 136, 0.15);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.08);
}

.keyword-item:hover {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.25);
}

.keyword-item::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--highlight);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.keyword-item:hover::before {
    background: var(--text-white);
    transform: scale(1.3);
}

/* Row variations - different color accents */
.row-1 .keyword-item {
    border-color: rgba(13, 148, 136, 0.2);
}

.row-2 .keyword-item {
    border-color: rgba(94, 234, 212, 0.4);
}

.row-2 .keyword-item::before {
    background: var(--primary);
}

.row-3 .keyword-item {
    border-color: rgba(19, 78, 74, 0.15);
}

.row-3 .keyword-item::before {
    background: var(--accent);
}

/* Pop-up Modal */
.article-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.article-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.article-modal {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.article-modal-overlay.active .article-modal {
    transform: translateY(0) scale(1);
}

.article-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--text-white);
}

.article-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    padding-right: 40px;
}

.article-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.article-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.article-modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-white);
}

.article-modal-body {
    padding: 32px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

/* Article content styling */
.article-modal-body h1,
.article-modal-body h2,
.article-modal-body h3 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 16px;
}

.article-modal-body h1:first-child,
.article-modal-body h2:first-child,
.article-modal-body h3:first-child {
    margin-top: 0;
}

.article-modal-body p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.article-modal-body ul,
.article-modal-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.article-modal-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.article-modal-body a {
    color: var(--primary);
    text-decoration: underline;
}

.article-modal-body a:hover {
    color: var(--primary-dark);
}

.article-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.article-modal-body blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--bg-alt);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Scrollbar styling for modal */
.article-modal-body::-webkit-scrollbar {
    width: 8px;
}

.article-modal-body::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.article-modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.article-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Hidden article content storage */
.article-content-storage {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .what-we-do-section {
        padding: 80px 0;
    }

    .keyword-carousel-wrapper::before,
    .keyword-carousel-wrapper::after {
        width: 60px;
    }
}

@media (max-width: 768px) {
    .what-we-do-section {
        padding: 60px 0;
    }

    .keyword-carousel-wrapper::before,
    .keyword-carousel-wrapper::after {
        width: 30px;
    }

    .keyword-item {
        padding: 12px 18px;
        font-size: 0.85rem;
        margin: 0 6px;
    }

    .article-modal {
        max-height: 90vh;
        margin: 10px;
    }

    .article-modal-header {
        padding: 16px 20px;
    }

    .article-modal-title {
        font-size: 1.1rem;
    }

    .article-modal-body {
        padding: 20px;
        max-height: calc(90vh - 70px);
    }

    .article-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .keyword-item {
        padding: 10px 14px;
        font-size: 0.8rem;
        margin: 0 4px;
    }

    .keyword-item::before {
        width: 6px;
        height: 6px;
    }

    .article-modal-body {
        padding: 16px;
    }

    .article-modal-body h2 {
        font-size: 1.25rem;
    }

    .article-modal-body p {
        font-size: 0.95rem;
    }
}

/* No keywords fallback */
.no-keywords-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-keywords-message p {
    font-size: 1.1rem;
}
