/**
 * RSS Feed Cards - Main Styles
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.rss-feed-cards-wrapper {
    width: 100%;
}

.rss-feed-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.rss-feed-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.rss-feed-card a {
    text-decoration: none;
}

/* ==========================================================================
   Image Styles
   ========================================================================== */

.rss-card-image-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background-color: #f0f0f0;
    background-image: linear-gradient(135deg, #f5f5f5 25%, transparent 25%),
                      linear-gradient(225deg, #f5f5f5 25%, transparent 25%),
                      linear-gradient(45deg, #f5f5f5 25%, transparent 25%),
                      linear-gradient(315deg, #f5f5f5 25%, #e8e8e8 25%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 0, 10px -10px, 0px 10px;
}

.rss-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center;
    transition: transform 0.3s ease, filter 0.3s ease, object-position 0.3s ease;
}

/* Image Hover Effects */
.rss-image-hover-zoom .rss-feed-card:hover .rss-card-image {
    transform: scale(1.08);
}

.rss-image-hover-grayscale .rss-card-image {
    filter: grayscale(100%);
}

.rss-image-hover-grayscale .rss-feed-card:hover .rss-card-image {
    filter: grayscale(0%);
}

.rss-image-hover-blur .rss-card-image {
    filter: blur(0);
}

.rss-image-hover-blur .rss-feed-card:hover .rss-card-image {
    filter: blur(2px);
}

/* Image Overlay */
.rss-card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.3s ease;
    pointer-events: none;
}

/* ==========================================================================
   Content Styles
   ========================================================================== */

.rss-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
}

.rss-card-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.rss-card-title a {
    color: inherit;
    transition: color 0.2s ease;
}

.rss-card-excerpt {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
    flex: 1;
}

/* ==========================================================================
   Meta Styles
   ========================================================================== */

.rss-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap;
    gap: 10px;
}

.rss-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #999999;
}

.rss-card-meta-separator {
    color: #cccccc;
}

.rss-card-date,
.rss-card-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rss-card-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ==========================================================================
   Source Badge Styles
   ========================================================================== */

.rss-card-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666666;
}

.rss-card-source-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.rss-card-source-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rss-card-source-name {
    font-weight: 500;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.rss-card-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    background: #007bff;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.rss-card-button:hover {
    background: #0056b3;
    color: #ffffff;
}

.rss-card-button .rss-card-icon {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Template: Classic
   ========================================================================== */

.rss-feed-card-classic {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rss-feed-card-classic:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Template: Overlay
   ========================================================================== */

.rss-feed-card-overlay {
    position: relative;
    min-height: 300px;
}

.rss-feed-card-overlay .rss-card-link-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rss-feed-card-overlay .rss-card-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0;
}

.rss-card-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: none;
}

.rss-card-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: #ffffff;
    z-index: 2;
}

.rss-feed-card-overlay .rss-card-title,
.rss-feed-card-overlay .rss-card-title a {
    color: #ffffff;
}

.rss-feed-card-overlay .rss-card-excerpt {
    color: rgba(255, 255, 255, 0.85);
}

.rss-feed-card-overlay .rss-card-meta,
.rss-feed-card-overlay .rss-card-source {
    color: rgba(255, 255, 255, 0.75);
}

.rss-feed-card-overlay .rss-card-source {
    margin-bottom: 10px;
}

/* ==========================================================================
   Template: Horizontal
   ========================================================================== */

.rss-feed-card-horizontal {
    flex-direction: row;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rss-template-horizontal .rss-feed-cards-grid {
    grid-template-columns: 1fr;
}

.rss-card-image-horizontal {
    width: 280px;
    min-width: 280px;
    padding-bottom: 0;
    height: auto;
    min-height: 200px;
}

.rss-card-content-horizontal {
    justify-content: center;
}

.rss-feed-card-horizontal .rss-card-source {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .rss-feed-card-horizontal {
        flex-direction: column;
    }
    
    .rss-card-image-horizontal {
        width: 100%;
        min-width: 100%;
        padding-bottom: 56.25%;
    }
}

/* ==========================================================================
   Template: Minimal
   ========================================================================== */

.rss-feed-card-minimal {
    border-bottom: 1px solid #eee;
    border-radius: 0;
    background: transparent;
}

.rss-feed-card-minimal:last-child {
    border-bottom: none;
}

.rss-feed-card-minimal .rss-card-link-wrapper {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px 0;
}

.rss-feed-card-minimal .rss-card-content {
    flex: 1;
    padding: 0;
    order: 1;
}

.rss-card-image-minimal {
    width: 120px;
    min-width: 120px;
    height: 80px;
    padding-bottom: 0;
    border-radius: 8px;
    order: 2;
}

.rss-feed-card-minimal .rss-card-title {
    font-size: 16px;
    margin-bottom: 8px;
}

.rss-card-meta-top {
    margin-bottom: 8px;
}

.rss-card-source-minimal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rss-template-minimal .rss-feed-cards-grid {
    grid-template-columns: 1fr;
    gap: 0;
}

/* ==========================================================================
   Template: Magazine
   ========================================================================== */

.rss-feed-card-magazine {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rss-feed-card-magazine .rss-card-image-wrapper {
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
}

.rss-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ff4757;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.rss-feed-card-magazine .rss-card-source {
    margin-bottom: 12px;
}

.rss-feed-card-magazine .rss-card-title {
    font-size: 20px;
}

.rss-feed-card-magazine .rss-card-footer {
    border-top: 1px solid #eee;
    padding-top: 16px;
    margin-top: 16px;
}

.rss-feed-card-magazine .rss-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* ==========================================================================
   Template: Card Small
   ========================================================================== */

.rss-feed-card-small {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.rss-feed-card-small .rss-card-link-wrapper {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 12px;
}

.rss-card-image-small {
    width: 80px;
    min-width: 80px;
    height: 60px;
    padding-bottom: 0;
    border-radius: 6px;
}

.rss-feed-card-small .rss-card-content {
    padding: 0;
    justify-content: center;
}

.rss-feed-card-small .rss-card-title {
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.rss-card-source-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rss-card-source-small .rss-card-source-icon {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

.rss-feed-card-skeleton {
    background: #ffffff;
}

.skeleton-image,
.skeleton-title,
.skeleton-excerpt,
.skeleton-meta {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.skeleton-title {
    height: 24px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-excerpt {
    height: 60px;
    width: 100%;
    margin-bottom: 16px;
}

.skeleton-meta {
    height: 16px;
    width: 50%;
}

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

/* ==========================================================================
   Loading States
   ========================================================================== */

.rss-feed-cards-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.rss-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    100% {
        transform: rotate(360deg);
    }
}

.rss-loading-dots {
    display: flex;
    gap: 8px;
}

.rss-loading-dots span {
    width: 10px;
    height: 10px;
    background: #007bff;
    border-radius: 50%;
    animation: dots-pulse 1.4s ease-in-out infinite both;
}

.rss-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.rss-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dots-pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Notice & Error States
   ========================================================================== */

.rss-feed-cards-notice,
.rss-feed-cards-error,
.rss-feed-cards-empty {
    padding: 20px;
    text-align: center;
    border-radius: 8px;
}

.rss-feed-cards-notice {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.rss-feed-cards-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.rss-feed-cards-empty {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

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

@media (max-width: 1024px) {
    .rss-feed-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rss-feed-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .rss-card-title {
        font-size: 16px;
    }
    
    .rss-card-content {
        padding: 16px;
    }
    
    .rss-card-button {
        width: 100%;
        justify-content: center;
    }
}

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

@media (prefers-color-scheme: dark) {
    .rss-feed-card {
        background: #1a1a1a;
    }
    
    .rss-card-title,
    .rss-card-title a {
        color: #ffffff;
    }
    
    .rss-card-excerpt {
        color: #a0a0a0;
    }
    
    .rss-card-meta {
        color: #808080;
    }
    
    .rss-card-source {
        color: #a0a0a0;
    }
    
    .rss-card-source-badge {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .rss-feed-card-minimal {
        border-bottom-color: #333;
    }
    
    .rss-feed-card-magazine .rss-card-footer {
        border-top-color: #333;
    }
    
    .skeleton-image,
    .skeleton-title,
    .skeleton-excerpt,
    .skeleton-meta {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}
