/* ================================================================
   Olotys Resources Manager — Frontend Styles
   Branding: #005F73 (Teal) | #C07A5C (Terracotta) | #FAF6F1 (Cream)
   ================================================================ */

/* CSS Variables (overridden by admin settings via inline style) */
:root {
    --olotys-primary: #005F73;
    --olotys-primary-light: rgba(0, 95, 115, 0.08);
    --olotys-primary-hover: rgba(0, 95, 115, 0.87);
    --olotys-secondary: #C07A5C;
    --olotys-bg: #FAF6F1;
    --olotys-text: #1A1A1A;
    --olotys-card-bg: #FFFFFF;
    --olotys-radius: 12px;
    --olotys-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --olotys-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --olotys-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======================== Wrapper ======================== */
.olotys-resources-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: "Roboto", Sans-serif;
    color: var(--olotys-text);
    line-height: 1.7;
}

.olotys-resources-wrapper *,
.olotys-resources-wrapper *::before,
.olotys-resources-wrapper *::after {
    box-sizing: border-box;
}

/* ======================== Section Header ======================== */
.olotys-header {
    display: none; /* Removed as per request */
}

/* ======================== Search Bar ======================== */
.olotys-search-wrapper {
    display: none; /* Removed as per request */
}

.olotys-search {
    position: relative;
    display: flex;
    align-items: center;
}

.olotys-search-icon {
    position: absolute;
    left: 18px;
    color: #999;
    pointer-events: none;
    transition: color 0.2s;
}

.olotys-search-input {
    width: 100%;
    padding: 16px 50px 16px 52px;
    border: 2px solid #e2e2e2;
    border-radius: 50px;
    font-size: 15px;
    color: var(--olotys-text);
    background: var(--olotys-card-bg);
    outline: none;
    transition: var(--olotys-transition);
    font-family: inherit;
}

.olotys-search-input::placeholder {
    color: #aaa;
}

.olotys-search-input:focus {
    border-color: var(--olotys-primary);
    box-shadow: 0 0 0 4px var(--olotys-primary-light);
}

.olotys-search-input:focus ~ .olotys-search-icon {
    color: var(--olotys-primary);
}

.olotys-search-clear {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.olotys-search-clear:hover {
    color: var(--olotys-text);
}

/* ======================== Topic Cards Grid ======================== */
.olotys-topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.olotys-topic-card {
    background: var(--olotys-card-bg);
    border: 2px solid #eee;
    border-radius: var(--olotys-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--olotys-transition);
    position: relative;
    overflow: hidden;
}

.olotys-topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--olotys-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.olotys-topic-card:hover {
    border-color: var(--olotys-primary);
    box-shadow: var(--olotys-shadow-hover);
    transform: translateY(-4px);
}

.olotys-topic-card:hover::before {
    transform: scaleX(1);
}

.olotys-topic-card.active {
    border-color: var(--olotys-primary);
    background: var(--olotys-primary-light);
    box-shadow: 0 4px 20px rgba(0, 95, 115, 0.15);
}

.olotys-topic-card.active::before {
    transform: scaleX(1);
}

/* Topic Icon */
.olotys-topic-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.olotys-topic-icon-wrap svg {
    color: var(--olotys-primary);
    width: 48px;
    height: 48px;
}

.olotys-topic-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.olotys-topic-card:hover .olotys-topic-icon {
    transform: scale(1.1);
}

/* Topic Text */
.olotys-topic-title {
    font-family: "Georgia Pro", Sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.olotys-topic-card.active .olotys-topic-title {
    color: var(--olotys-primary);
}

.olotys-topic-desc {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

/* All Topics Card (SVG icon) */
.olotys-topic-all .olotys-topic-icon-wrap svg {
    width: 42px;
    height: 42px;
}

/* ======================== Sub-filter Tags ======================== */
.olotys-subtags-wrapper {
    margin-bottom: 30px;
    padding: 0 5px;
    animation: olotys-slideDown 0.3s ease;
}

@keyframes olotys-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.olotys-subtags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.olotys-tag {
    padding: 8px 20px;
    border: 1.5px solid #ddd;
    border-radius: 50px;
    background: var(--olotys-card-bg);
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--olotys-transition);
    font-family: inherit;
    white-space: nowrap;
}

.olotys-tag:hover {
    border-color: var(--olotys-primary);
    color: var(--olotys-primary);
    background: var(--olotys-primary-light);
}

.olotys-tag.active {
    background: var(--olotys-primary);
    color: #fff;
    border-color: var(--olotys-primary);
}

/* ======================== Loading Spinner ======================== */
.olotys-loading {
    text-align: center;
    padding: 50px 20px;
}

.olotys-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top: 3px solid var(--olotys-primary);
    border-radius: 50%;
    animation: olotys-spin 0.8s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes olotys-spin {
    to { transform: rotate(360deg); }
}

.olotys-loading p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* ======================== Article Cards Grid ======================== */
.olotys-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin-bottom: 60px;
}

.olotys-article-card {
    background: var(--olotys-card-bg);
    border-radius: var(--olotys-radius);
    overflow: hidden;
    box-shadow: var(--olotys-shadow);
    transition: var(--olotys-transition);
    display: flex;
    flex-direction: column;
    animation: olotys-fadeIn 0.4s ease;
}

@keyframes olotys-fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.olotys-article-card:hover {
    box-shadow: var(--olotys-shadow-hover);
    transform: translateY(-6px);
}

/* Article Thumbnail */
.olotys-article-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: #f0f0f0;
}

.olotys-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.olotys-article-card:hover .olotys-article-thumb img {
    transform: scale(1.05);
}

/* Article Content */
.olotys-article-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Badges */
.olotys-article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.olotys-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 50px;
    background: var(--olotys-primary-light);
    color: var(--olotys-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Article Title */
.olotys-article-title {
    font-family: "Georgia Pro", Sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.olotys-article-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.olotys-article-title a:hover {
    color: var(--olotys-primary);
}

/* Article Excerpt */
.olotys-article-excerpt {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.7;
    flex-grow: 1;
}

/* Article Tags */
.olotys-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.olotys-article-tag {
    padding: 2px 12px;
    border-radius: 4px;
    background: #f5f5f5;
    color: #777;
    font-size: 15px;
    font-weight: 500;
}

/* Article Footer */
.olotys-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.olotys-article-date {
    font-size: 12px;
    color: #999;
}

.olotys-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--olotys-primary);
    text-decoration: none;
    transition: var(--olotys-transition);
}

.olotys-read-more svg {
    transition: transform 0.2s;
}

.olotys-read-more:hover {
    color: var(--olotys-primary-hover);
}

.olotys-read-more:hover svg {
    transform: translateX(4px);
}

/* ======================== No Results ======================== */
.olotys-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.olotys-no-results svg {
    color: #ddd;
    margin-bottom: 15px;
}

.olotys-no-results h3 {
    font-size: 20px;
    color: #666;
    margin: 0 0 8px 0;
}

.olotys-no-results p {
    font-size: 14px;
    margin: 0;
}

/* ======================== Load More ======================== */
.olotys-load-more-wrap {
    text-align: center;
    margin-bottom: 50px;
}

.olotys-load-more {
    padding: 14px 40px;
    border: 2px solid var(--olotys-primary);
    border-radius: 50px;
    background: transparent;
    color: var(--olotys-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--olotys-transition);
    font-family: inherit;
}

.olotys-load-more:hover {
    background: var(--olotys-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 95, 115, 0.25);
}

/* ======================== CTA Section ======================== */
.olotys-cta {
    background: var(--olotys-secondary);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.olotys-cta::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.olotys-cta::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.olotys-cta-content {
    position: relative;
    z-index: 1;
}

.olotys-cta-title {
    font-family: "Georgia Pro", Sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 24px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}

.olotys-cta-desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 35px 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.olotys-cta-button {
    display: inline-block;
    padding: 14px 36px;
    border: 2px solid #fff;
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--olotys-transition);
    background: transparent;
}

.olotys-cta-button:hover {
    background: #fff;
    color: var(--olotys-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ======================== Responsive ======================== */
@media (max-width: 1024px) {
    .olotys-topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .olotys-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .olotys-resources-wrapper {
        padding: 25px 15px;
    }

    .olotys-title {
        font-size: 28px;
    }

    .olotys-description {
        font-size: 14px;
    }

    .olotys-topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .olotys-topic-card {
        padding: 20px 15px;
    }

    .olotys-topic-icon-wrap {
        width: 56px;
        height: 56px;
    }

    .olotys-topic-desc {
        display: none;
    }

    .olotys-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .olotys-article-content {
        padding: 15px;
    }

    .olotys-cta {
        padding: 40px 25px;
        border-radius: 12px;
    }

    .olotys-cta-title {
        font-size: 22px;
    }

    .olotys-subtags {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .olotys-subtags::-webkit-scrollbar {
        height: 4px;
    }

    .olotys-subtags::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .olotys-topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .olotys-articles-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .olotys-topic-card {
        padding: 16px 12px;
    }

    .olotys-topic-icon-wrap {
        width: 48px;
        height: 48px;
    }

    .olotys-topic-title {
        font-size: 13px;
    }

    .olotys-title {
        font-size: 24px;
    }

    .olotys-search-input {
        padding: 14px 45px 14px 48px;
        font-size: 14px;
    }

    .olotys-cta-button {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* ======================== Animations ======================== */
.olotys-article-card.olotys-entering {
    animation: olotys-fadeIn 0.4s ease forwards;
}

.olotys-article-card.olotys-exiting {
    animation: olotys-fadeOut 0.3s ease forwards;
}

@keyframes olotys-fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Staggered animation for cards */
.olotys-article-card:nth-child(1) { animation-delay: 0.0s; }
.olotys-article-card:nth-child(2) { animation-delay: 0.05s; }
.olotys-article-card:nth-child(3) { animation-delay: 0.1s; }
.olotys-article-card:nth-child(4) { animation-delay: 0.15s; }
.olotys-article-card:nth-child(5) { animation-delay: 0.2s; }
.olotys-article-card:nth-child(6) { animation-delay: 0.25s; }
.olotys-article-card:nth-child(7) { animation-delay: 0.3s; }
.olotys-article-card:nth-child(8) { animation-delay: 0.35s; }
.olotys-article-card:nth-child(9) { animation-delay: 0.4s; }
.olotys-article-card:nth-child(10) { animation-delay: 0.45s; }
.olotys-article-card:nth-child(11) { animation-delay: 0.5s; }
.olotys-article-card:nth-child(12) { animation-delay: 0.55s; }

/* Topic card stagger */
.olotys-topic-card:nth-child(1) { animation: olotys-fadeIn 0.3s ease 0.0s both; }
.olotys-topic-card:nth-child(2) { animation: olotys-fadeIn 0.3s ease 0.05s both; }
.olotys-topic-card:nth-child(3) { animation: olotys-fadeIn 0.3s ease 0.1s both; }
.olotys-topic-card:nth-child(4) { animation: olotys-fadeIn 0.3s ease 0.15s both; }
.olotys-topic-card:nth-child(5) { animation: olotys-fadeIn 0.3s ease 0.2s both; }
.olotys-topic-card:nth-child(6) { animation: olotys-fadeIn 0.3s ease 0.25s both; }
.olotys-topic-card:nth-child(7) { animation: olotys-fadeIn 0.3s ease 0.3s both; }
.olotys-topic-card:nth-child(8) { animation: olotys-fadeIn 0.3s ease 0.35s both; }
.olotys-topic-card:nth-child(9) { animation: olotys-fadeIn 0.3s ease 0.4s both; }

/* Print styles */
@media print {
    .olotys-search-wrapper,
    .olotys-subtags-wrapper,
    .olotys-load-more-wrap {
        display: none !important;
    }

    .olotys-topic-card {
        break-inside: avoid;
    }

    .olotys-article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
