/**
 * RS Theme Widgets - Frontend Styles
 * @package RS_Theme_Widgets
 */

/* ==========================================================================
   Base Widget Styles
   ========================================================================== */

[class*="rs-"][class*="-widget"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 1.5rem;
}

[class*="rs-"][class*="-widget"] .widget-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #6366f1, #ec4899) 1;
}

[class*="rs-"][class*="-widget"] .widget-title svg {
    color: #6366f1;
    flex-shrink: 0;
}

/* ==========================================================================
   Popular Posts Widget
   ========================================================================== */

.rs-popular-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rs-popular-post-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.rs-popular-post-item:last-child {
    border-bottom: none;
}

.rs-popular-post-item:hover {
    transform: translateX(4px);
}

.rs-popular-post-item .post-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    flex-shrink: 0;
}

.rs-popular-post-item .post-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.rs-popular-post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rs-popular-post-item:hover .post-thumbnail img {
    transform: scale(1.1);
}

.rs-popular-post-item .post-content {
    flex: 1;
    min-width: 0;
}

.rs-popular-post-item .post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    line-height: 1.4;
}

.rs-popular-post-item .post-title a {
    color: #334155;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rs-popular-post-item .post-title a:hover {
    color: #6366f1;
}

.rs-popular-post-item .post-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.rs-popular-post-item .post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================================================
   Recent Posts Widget
   ========================================================================== */

.rs-recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rs-recent-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s ease;
}

.rs-recent-post-item:last-child {
    border-bottom: none;
}

.rs-recent-post-item .post-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.rs-recent-post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rs-recent-post-item:hover .post-thumbnail img {
    transform: scale(1.1);
}

.rs-recent-post-item .no-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.rs-recent-post-item .post-content {
    flex: 1;
    min-width: 0;
}

.rs-recent-post-item .post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    line-height: 1.4;
}

.rs-recent-post-item .post-title a {
    color: #334155;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rs-recent-post-item .post-title a:hover {
    color: #6366f1;
}

.rs-recent-post-item .post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
}

.rs-recent-post-item .post-excerpt {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.35rem 0 0;
    line-height: 1.5;
}

/* ==========================================================================
   Categories Widget
   ========================================================================== */

.rs-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* List Style */
.rs-categories-list.rs-categories-list .rs-category-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    color: #475569;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.rs-categories-list.rs-categories-list .rs-category-item:last-child a {
    border-bottom: none;
}

.rs-categories-list.rs-categories-list .rs-category-item a:hover {
    color: #6366f1;
    padding-left: 0.5rem;
}

.rs-categories-list .category-icon {
    font-size: 1rem;
}

.rs-categories-list .category-name {
    flex: 1;
    font-weight: 500;
}

.rs-categories-list .category-count {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

/* Boxes Style */
.rs-categories-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.rs-categories-boxes .rs-category-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    background: #f8fafc;
    border-radius: 10px;
    text-align: center;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.rs-categories-boxes .rs-category-item a:hover {
    background: #fff;
    border-color: #6366f1;
    color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.rs-categories-boxes .category-icon {
    font-size: 1.25rem;
}

.rs-categories-boxes .category-name {
    font-size: 0.8rem;
    font-weight: 500;
}

.rs-categories-boxes .category-count {
    font-size: 0.65rem;
    background: #e2e8f0;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
}

/* Pills Style */
.rs-categories-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rs-categories-pills .rs-category-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #f1f5f9;
    border-radius: 20px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.rs-categories-pills .rs-category-item a:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.rs-categories-pills .category-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ==========================================================================
   Social Links Widget
   ========================================================================== */

.rs-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rs-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s ease;
}

.rs-social-link:hover {
    transform: translateY(-3px);
}

/* Icons Style */
.rs-social-icons .rs-social-link {
    background: transparent;
}

.rs-social-icons .rs-social-link:hover {
    color: #6366f1;
}

/* Rounded Style */
.rs-social-rounded .rs-social-link {
    background: #f1f5f9;
    border-radius: 50%;
}

.rs-social-rounded .rs-social-link:hover {
    color: #fff;
}

/* Square Style */
.rs-social-square .rs-social-link {
    background: #f1f5f9;
    border-radius: 10px;
}

.rs-social-square .rs-social-link:hover {
    color: #fff;
}

/* Social Colors */
.rs-social-facebook:hover {
    background: #1877f2 !important;
    color: #fff !important;
}

.rs-social-twitter:hover {
    background: #000 !important;
    color: #fff !important;
}

.rs-social-instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) !important;
    color: #fff !important;
}

.rs-social-youtube:hover {
    background: #ff0000 !important;
    color: #fff !important;
}

.rs-social-linkedin:hover {
    background: #0a66c2 !important;
    color: #fff !important;
}

.rs-social-github:hover {
    background: #333 !important;
    color: #fff !important;
}

.rs-social-pinterest:hover {
    background: #e60023 !important;
    color: #fff !important;
}

.rs-social-tiktok:hover {
    background: #000 !important;
    color: #fff !important;
}

.rs-social-telegram:hover {
    background: #0088cc !important;
    color: #fff !important;
}

.rs-social-whatsapp:hover {
    background: #25d366 !important;
    color: #fff !important;
}

.rs-social-discord:hover {
    background: #5865f2 !important;
    color: #fff !important;
}

.rs-social-rss:hover {
    background: #f26522 !important;
    color: #fff !important;
}

/* ==========================================================================
   Newsletter Widget
   ========================================================================== */

.rs-newsletter-container {
    text-align: center;
}

.rs-newsletter-container .newsletter-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.rs-newsletter-form {
    margin-bottom: 0.75rem;
}

.rs-newsletter-form .newsletter-input-group {
    display: flex;
    gap: 0.5rem;
}

.rs-newsletter-form input[type="email"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: #fff;
}

.rs-newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: #6366f1;
}

.rs-newsletter-form .newsletter-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rs-newsletter-form .newsletter-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.newsletter-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Gradient Style */
.rs-newsletter-gradient {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    padding: 1.5rem;
    border-radius: 12px;
    color: #fff;
}

.rs-newsletter-gradient .widget-title,
.rs-newsletter-gradient .newsletter-description {
    color: #fff;
}

.rs-newsletter-gradient .newsletter-privacy {
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   About Widget
   ========================================================================== */

.rs-about-container {
    text-align: center;
}

.rs-about-container .about-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid transparent;
    background: linear-gradient(135deg, #6366f1, #ec4899) border-box;
    padding: 3px;
}

.rs-about-container .about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.rs-about-container .about-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.rs-about-container .about-bio {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.rs-about-container .about-social {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.rs-about-container .about-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.rs-about-container .about-social a:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    transform: translateY(-2px);
}

/* ==========================================================================
   Ads Widget
   ========================================================================== */

.rs-ad-container {
    position: relative;
    text-align: center;
}

.rs-ad-container .rs-ad-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.rs-ad-container .ad-label {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.rs-ad-container.rs-ad-responsive .rs-ad-image {
    width: 100%;
}

/* ==========================================================================
   Tags Cloud Widget
   ========================================================================== */

.rs-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rs-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.rs-tag-item:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    transform: translateY(-2px);
}

.rs-tag-item .tag-count {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
}

/* Outlined Style */
.rs-tags-outlined .rs-tag-item {
    background: transparent;
    border: 1px solid #e2e8f0;
}

.rs-tags-outlined .rs-tag-item:hover {
    background: #6366f1;
    border-color: #6366f1;
}

/* Gradient Style */
.rs-tags-gradient .rs-tag-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.rs-tags-gradient .rs-tag-item:hover {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    border-color: transparent;
}

/* Minimal Style */
.rs-tags-minimal .rs-tag-item {
    background: transparent;
    padding: 0.25rem 0;
    border-radius: 0;
}

.rs-tags-minimal .rs-tag-item:hover {
    background: transparent;
    color: #6366f1;
    transform: none;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    [class*="rs-"][class*="-widget"] {
        padding: 1.25rem;
    }

    .rs-categories-boxes {
        grid-template-columns: 1fr;
    }

    .rs-newsletter-form .newsletter-input-group {
        flex-direction: column;
    }

    .rs-newsletter-form .newsletter-submit {
        width: 100%;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    [class*="rs-"][class*="-widget"] {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
        border-color: rgba(99, 102, 241, 0.2);
    }

    [class*="rs-"][class*="-widget"] .widget-title {
        color: #f1f5f9;
    }

    .rs-popular-post-item .post-title a,
    .rs-recent-post-item .post-title a {
        color: #e2e8f0;
    }

    .rs-categories-list .rs-category-item a,
    .rs-tag-item {
        color: #cbd5e1;
    }

    .rs-newsletter-form input[type="email"] {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }

    .rs-about-container .about-name {
        color: #f1f5f9;
    }

    .rs-about-container .about-bio,
    .rs-popular-post-item .post-meta,
    .rs-recent-post-item .post-date {
        color: #94a3b8;
    }
}