/**
 * Public styles for Edu Amp Quick Articles
 *
 * Styles for both the article list shortcode and single article template
 *
 * @package    Edu_Amp_Quick_Articles
 * @subpackage Edu_Amp_Quick_Articles/public/css
 * @since      1.0.0
 */

:root {
    --eaqa-primary: #667eea;
    --eaqa-secondary: #764ba2;
    --eaqa-text: #1e1e1e;
    --eaqa-meta: #93a4b0;
    --eaqa-background: #ffffff;
    --eaqa-border: #e5e5e5;
}

.eaqa-articles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    z-index: 9999;
    background: var(--eaqa-background);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
    .eaqa-articles-container {
        width: 50%;
        margin-left: 25% !important;
    }
}

.eaqa-instant-articles {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: transparent;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.eaqa-news-header {
    padding: 15px;
    position: relative;
    flex-shrink: 0;
    border-bottom: 1px solid var(--eaqa-border);
    background: var(--eaqa-background);
}

.eaqa-news-heading {
    font-size: 16px;
    font-weight: bold;
    color: var(--eaqa-text);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.eaqa-heading-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eaqa-custom-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.eaqa-zap-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.eaqa-back-button {
    position: absolute;
    right: 15px;
    top: 15px;
    text-decoration: none;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.eaqa-back-button:hover {
    transform: scale(1.1);
}

.eaqa-article-icon,
.eaqa-zap-icon,
.eaqa-back-icon {
    width: 24px;
    height: 24px;
    fill: var(--eaqa-meta);
    transition: fill 0.2s ease;
}

.eaqa-zap-container a:hover .eaqa-zap-icon,
.eaqa-back-button:hover .eaqa-back-icon {
    fill: var(--eaqa-primary);
}

.eaqa-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--eaqa-meta);
}

.eaqa-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--eaqa-border);
    border-top: 4px solid var(--eaqa-primary);
    border-radius: 50%;
    animation: eaqa-spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.eaqa-news-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    flex: 1;
    padding: 15px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.eaqa-news-grid::-webkit-scrollbar {
    display: none;
}

.eaqa-ad-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
    text-align: center;
    border: 1px dashed var(--eaqa-border);
}

.eaqa-news-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: transform 0.2s ease;
}

.eaqa-news-item:hover {
    transform: translateX(4px);
}

.eaqa-first-news-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eaqa-first-news-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.eaqa-news-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.eaqa-news-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.eaqa-first-news-content {
    order: 2;
}

.eaqa-news-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--eaqa-meta);
    text-decoration: none !important;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.eaqa-news-title:hover {
    color: var(--eaqa-primary);
    text-decoration: none;
}

.eaqa-first-news-title {
    -webkit-line-clamp: 2;
    font-size: 18px;
    font-weight: bold;
    margin-top: 8px;
    color: var(--eaqa-text);
    text-decoration: none;
}

.eaqa-first-news-title:hover {
    color: var(--eaqa-primary);
    text-decoration: none;
}

.eaqa-news-meta {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--eaqa-meta);
    gap: 5px;
}

.eaqa-first-news-meta {
    order: 1;
    margin-top: 5px;
}

.eaqa-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.eaqa-author-name {
    color: var(--eaqa-meta);
    font-weight: 500;
}

.eaqa-meta-separator {
    color: var(--eaqa-meta);
}

.eaqa-post-date {
    color: var(--eaqa-meta);
}

.eaqa-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: var(--eaqa-meta);
    font-size: 16px;
}

.eaqa-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: #f5f5f5;
    flex-shrink: 0;
    border-top: 1px solid var(--eaqa-border);
}

.eaqa-footer a,
.eaqa-footer-link {
    color: var(--eaqa-meta);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.eaqa-footer a:hover,
.eaqa-footer-link:hover {
    color: var(--eaqa-primary);
    text-decoration: underline;
}

body.eaqa-instant-mode .site-header,
body.eaqa-instant-mode header.site-header,
body.eaqa-instant-mode .site-footer,
body.eaqa-instant-mode footer.site-footer,
body.eaqa-instant-mode .sidebar,
body.eaqa-instant-mode aside,
body.eaqa-homepage-mode .site-header,
body.eaqa-homepage-mode header.site-header,
body.eaqa-homepage-mode .site-footer,
body.eaqa-homepage-mode footer.site-footer,
body.eaqa-homepage-mode .sidebar,
body.eaqa-homepage-mode aside {
    display: none !important;
}

body.eaqa-instant-mode,
body.eaqa-homepage-mode {
    padding: 0 !important;
    margin: 0 !important;
}

body.eaqa-instant-mode.admin-bar .eaqa-instant-container,
body.eaqa-homepage-mode.admin-bar .eaqa-articles-container {
    padding-top: 32px;
}

@media screen and (max-width: 782px) {
    body.eaqa-instant-mode.admin-bar .eaqa-instant-container,
    body.eaqa-homepage-mode.admin-bar .eaqa-articles-container {
        padding-top: 46px;
    }
}

.eaqa-instant-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    margin: 0 auto;
    background: var(--eaqa-background);
    color: var(--eaqa-text);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.eaqa-instant-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.eaqa-instant-content::-webkit-scrollbar {
    display: none;
}

.eaqa-instant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--eaqa-border);
    flex-shrink: 0;
    background: var(--eaqa-background);
}

.eaqa-header-left,
.eaqa-header-center,
.eaqa-header-right {
    display: flex;
    align-items: center;
}

.eaqa-header-left {
    flex: 1;
    justify-content: flex-start;
    gap: 8px;
}

.eaqa-header-center {
    margin: 0 20px;
}

.eaqa-header-right {
    flex: 1;
    justify-content: flex-end;
}

.eaqa-header-left .eaqa-custom-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.eaqa-instant-article-text {
    font-size: 16px;
    font-weight: bold;
    color: var(--eaqa-text);
    white-space: nowrap;
}

.eaqa-header-left svg,
.eaqa-header-center svg,
.eaqa-header-right svg {
    width: 24px;
    height: 24px;
    fill: var(--eaqa-meta);
    transition: fill 0.2s ease;
}

.eaqa-header-left a,
.eaqa-header-center a,
.eaqa-header-right a {
    text-decoration: none;
    cursor: pointer;
}

.eaqa-header-left a:hover svg,
.eaqa-header-center a:hover svg,
.eaqa-header-right a:hover svg {
    fill: var(--eaqa-primary);
}

.eaqa-instant-content {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    color: var(--eaqa-text);
}

.eaqa-post-header {
    padding: 10px;
}

.eaqa-instant-content .entry-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: var(--eaqa-text);
    line-height: 1.3;
}

.eaqa-post-meta {
    display: flex;
    align-items: center;
    margin: 0 0 15px 0;
    gap: 10px;
}

.eaqa-author-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 24px;
}

.eaqa-meta-text {
    display: flex;
    align-items: center;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 5px;
}

.eaqa-author-name {
    font-weight: 600;
    color: var(--eaqa-text);
}

.eaqa-meta-separator {
    color: var(--eaqa-meta);
}

.eaqa-post-date,
.eaqa-read-time {
    color: var(--eaqa-meta);
}

.eaqa-featured-image {
    margin-bottom: 15px;
}

.eaqa-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.eaqa-instant-content .entry-content {
    line-height: 1.7;
    padding: 0 10px;
    color: var(--eaqa-text);
    font-size: 16px;
}

.eaqa-instant-content .entry-content p {
    margin-bottom: 1.5em;
}

.eaqa-instant-content .entry-content img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.eaqa-instant-content .entry-content a {
    color: var(--eaqa-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.eaqa-instant-content .entry-content a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.eaqa-ad {
    margin: 2px 2px;
    padding: 5px;
    background: #f8f8f8;
    text-align: center;
    border-radius: 8px;
}

.eaqa-ad-below-image,
.eaqa-ad-after-paragraph,
.eaqa-ad-end-of-article {
    border: 1px dashed var(--eaqa-border);
}

.eaqa-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-top: 1px solid var(--eaqa-border);
    margin: 20px 10px 0 10px;
}

.eaqa-views,
.eaqa-likes {
    display: flex;
    align-items: center;
    color: var(--eaqa-meta);
    font-size: 14px;
    gap: 8px;
}

.eaqa-views svg,
.eaqa-likes svg {
    width: 24px;
    height: 24px;
}

.eaqa-likes {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.eaqa-likes:hover {
    transform: scale(1.05);
}

.eaqa-likes.eaqa-liked {
    cursor: default;
}

.eaqa-likes.eaqa-liked svg path {
    fill: #ff0000;
}

.eaqa-instant-footer {
    display: flex;
    justify-content: center;
    padding: 15px;
    border-top: 1px solid var(--eaqa-border);
    flex-shrink: 0;
    background: #f5f5f5;
    gap: 20px;
}

.eaqa-instant-footer a {
    margin: 0;
    text-decoration: none;
    color: var(--eaqa-meta);
    font-size: 14px;
    transition: color 0.2s ease;
}

.eaqa-instant-footer a:hover {
    color: var(--eaqa-primary);
    text-decoration: underline;
}

.eaqa-related-articles {
    margin-top: 40px;
    padding: 30px 10px 20px;
    border-top: 2px solid var(--eaqa-border);
}

.eaqa-related-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--eaqa-text);
    margin: 0 0 20px 0;
}

.eaqa-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.eaqa-related-item {
    background: var(--eaqa-background);
    border: 1px solid var(--eaqa-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eaqa-related-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.eaqa-related-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
    padding: 10px;
}

.eaqa-related-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    border-radius: 8px;
}

.eaqa-related-content {
    padding: 0;
    flex: 1;
}

.eaqa-related-article-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--eaqa-text);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.eaqa-related-link:hover .eaqa-related-article-title {
    color: var(--eaqa-primary);
}

.eaqa-related-meta {
    font-size: 13px;
    color: var(--eaqa-meta);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.eaqa-related-author {
    font-weight: 500;
}

.eaqa-related-date {
    color: var(--eaqa-meta);
}

@media (min-width: 1024px) {
    .eaqa-instant-container {
        width: 50%;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .eaqa-instant-content .entry-title {
        font-size: 20px;
    }

    .eaqa-instant-content .entry-content {
        font-size: 15px;
    }

    .eaqa-news-header {
        padding: 12px;
    }

    .eaqa-news-grid {
        padding: 12px;
        gap: 12px;
    }

    .eaqa-first-news-title {
        font-size: 16px;
    }

    .eaqa-news-title {
        font-size: 14px;
    }

    .eaqa-related-articles {
        margin-top: 30px;
        padding-top: 20px;
    }

    .eaqa-related-title {
        font-size: 20px;
    }

    .eaqa-related-image {
        width: 80px;
        height: 80px;
    }

    .eaqa-related-content {
        padding: 0;
    }

    .eaqa-related-article-title {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .eaqa-instant-content .entry-title {
        font-size: 18px;
    }

    .eaqa-post-meta {
        flex-wrap: wrap;
    }

    .eaqa-footer {
        gap: 15px;
        padding: 12px;
        flex-wrap: wrap;
    }

    .eaqa-footer a {
        font-size: 13px;
    }

    .eaqa-instant-footer {
        flex-wrap: wrap;
    }

    .eaqa-instant-footer a {
        font-size: 13px;
    }

    .eaqa-related-link {
        padding: 8px;
        gap: 12px;
    }

    .eaqa-related-image {
        width: 70px;
        height: 70px;
    }
    
    .eaqa-related-article-title {
        font-size: 14px;
    }
}

.eaqa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.eaqa-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    animation: eaqa-slide-down 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.eaqa-message-success {
    background: #46b450;
    color: #fff;
}

.eaqa-message-error {
    background: #dc3232;
    color: #fff;
}

.eaqa-message-info {
    background: #00a0d2;
    color: #fff;
}

.eaqa-like-processing {
    animation: eaqa-pulse 0.3s ease;
}

.eaqa-like-success {
    animation: eaqa-bounce 0.6s ease;
}

@keyframes eaqa-slide-down {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes eaqa-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.95); }
}

@keyframes eaqa-bounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
}

@media print {
    .eaqa-instant-header,
    .eaqa-instant-footer,
    .eaqa-post-footer,
    .eaqa-ad,
    .eaqa-news-header,
    .eaqa-footer,
    .eaqa-related-articles,
    .eaqa-message {
        display: none !important;
    }

    .eaqa-instant-container,
    .eaqa-articles-container {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
    }

    .eaqa-instant-content,
    .eaqa-news-grid {
        overflow: visible;
    }
}