/**
 * Public styles for Crypto Articles Plugin v2.0
 */

/* ==========================================================================
   Single Article
   ========================================================================== */

.crypto-article {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.crypto-article-title {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.3;
}

.crypto-article-meta {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crypto-article-author,
.crypto-article-date,
.crypto-article-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.crypto-article-body {
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

.crypto-article-body h1,
.crypto-article-body h2,
.crypto-article-body h3,
.crypto-article-body h4,
.crypto-article-body h5,
.crypto-article-body h6 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #333;
}

.crypto-article-body h1 { font-size: 2em; }
.crypto-article-body h2 { font-size: 1.75em; }
.crypto-article-body h3 { font-size: 1.5em; }
.crypto-article-body h4 { font-size: 1.25em; }

.crypto-article-body p {
    margin-bottom: 15px;
}

.crypto-article-body ul,
.crypto-article-body ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.crypto-article-body li {
    margin-bottom: 8px;
}

.crypto-article-body blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    border-left: 4px solid #0073aa;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

.crypto-article-body pre,
.crypto-article-body code {
    background: #f5f5f5;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

.crypto-article-body code {
    padding: 2px 6px;
    font-size: 0.9em;
}

.crypto-article-body pre {
    padding: 15px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.crypto-article-body pre code {
    padding: 0;
    background: none;
}

.crypto-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

.crypto-article-body a {
    color: #0073aa;
    text-decoration: none;
}

.crypto-article-body a:hover {
    text-decoration: underline;
}

.crypto-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.crypto-article-body th,
.crypto-article-body td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.crypto-article-body th {
    background: #f5f5f5;
    font-weight: 600;
}

.crypto-article-tags {
    margin: 15px 0;
}

.crypto-article-tag {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: background 0.2s;
}

.crypto-article-tag:hover {
    background: #e0e0e0;
    color: #333;
}

.crypto-article-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #999;
}

.crypto-article-footer a {
    color: #999;
    text-decoration: none;
}

.crypto-article-footer a:hover {
    color: #666;
}

/* Template Variations */
.crypto-article-template-minimal {
    border: none;
    padding: 0;
    background: transparent;
}

.crypto-article-template-minimal .crypto-article-footer {
    display: none;
}

.crypto-article-template-boxed {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crypto-article-template-bordered {
    border-width: 2px;
}

/* ==========================================================================
   Dynamic Embed (Live Loading)
   ========================================================================== */

.crypto-article-embed {
    margin: 20px 0;
    min-height: 200px;
    position: relative;
}

.crypto-article-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
}

.crypto-article-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: crypto-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes crypto-spin {
    to { transform: rotate(360deg); }
}

.crypto-article-loading-text {
    font-size: 14px;
}

.crypto-article-error-container {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    text-align: center;
}

.crypto-article-error-container .error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.crypto-article-error-container .error-message {
    margin-bottom: 10px;
}

.crypto-article-error-container .error-help {
    font-size: 13px;
    color: #856404;
}

/* ==========================================================================
   Article List
   ========================================================================== */

.crypto-articles-list {
    display: grid;
    gap: 20px;
}

.crypto-articles-list.list-layout {
    grid-template-columns: 1fr;
}

.crypto-articles-list.grid-layout {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.crypto-article-item {
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: box-shadow 0.3s, transform 0.2s;
}

.crypto-article-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.crypto-article-item .crypto-article-title {
    margin-bottom: 10px;
}

.crypto-article-item .crypto-article-title a {
    text-decoration: none;
    color: #333;
}

.crypto-article-item .crypto-article-title a:hover {
    color: #0073aa;
}

.crypto-article-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

.crypto-article-read-more {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.crypto-article-read-more:hover {
    text-decoration: underline;
}

.crypto-article-read-more::after {
    content: '\2192';
}

.crypto-article-views {
    font-size: 13px;
    color: #999;
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.crypto-articles-widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crypto-article-widget-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.crypto-article-widget-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.crypto-article-widget-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.crypto-article-widget-item a:hover {
    color: #0073aa;
}

.crypto-article-widget-item small {
    color: #666;
    font-size: 12px;
}

/* ==========================================================================
   Error and Empty States
   ========================================================================== */

.crypto-articles-error,
.crypto-article-error {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

.crypto-article-error-message {
    margin: 0 0 10px 0;
    font-weight: 500;
}

.crypto-article-error-help {
    margin: 0;
    font-size: 13px;
    color: #856404;
}

.crypto-articles-empty {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    text-align: center;
}

/* ==========================================================================
   Protected Content Notice
   ========================================================================== */

.crypto-article-protected {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.crypto-article-protected-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.crypto-article-protected-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.crypto-article-protected-message {
    color: #666;
    margin-bottom: 15px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .crypto-article {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .crypto-article-footer {
        display: none;
    }

    .crypto-article-embed .crypto-article-loading,
    .crypto-article-embed .crypto-article-error-container {
        display: none;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .crypto-article {
        background: #1e1e1e;
        border-color: #333;
        color: #e0e0e0;
    }

    .crypto-article-title {
        color: #fff;
    }

    .crypto-article-body {
        color: #ccc;
    }

    .crypto-article-body h1,
    .crypto-article-body h2,
    .crypto-article-body h3,
    .crypto-article-body h4 {
        color: #fff;
    }

    .crypto-article-body blockquote {
        background: #2a2a2a;
        border-color: #0073aa;
    }

    .crypto-article-body pre,
    .crypto-article-body code {
        background: #2a2a2a;
    }

    .crypto-article-body th {
        background: #2a2a2a;
    }

    .crypto-article-body th,
    .crypto-article-body td {
        border-color: #444;
    }

    .crypto-article-tag {
        background: #333;
        color: #ccc;
    }

    .crypto-article-footer {
        border-color: #333;
    }

    .crypto-article-item {
        background: #1e1e1e;
        border-color: #333;
    }

    .crypto-article-item .crypto-article-title a {
        color: #fff;
    }

    .crypto-article-loading {
        background: #2a2a2a;
        border-color: #444;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .crypto-article {
        padding: 15px;
        margin: 15px 0;
    }

    .crypto-article-title {
        font-size: 1.5em;
    }

    .crypto-article-body {
        font-size: 16px;
    }

    .crypto-article-meta {
        flex-direction: column;
        gap: 5px;
    }

    .crypto-articles-list.grid-layout {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .crypto-article {
        padding: 12px;
        border-radius: 6px;
    }

    .crypto-article-title {
        font-size: 1.25em;
    }
}
