/* ==========================================================================
   XUI Modern Blog Sidebar Widgets
   Matches the bespoke, clean editorial aesthetic (Apple / Stripe style)
   ========================================================================== */

/* Universal Card Wrapper for XUI Widgets */
.xui-sidebar-widget {
    margin-bottom: 24px;
    font-family: inherit;
    box-sizing: border-box;
}

.xui-sidebar-widget *,
.xui-sidebar-widget *::before,
.xui-sidebar-widget *::after {
    box-sizing: border-box;
}

.xui-sidebar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.xui-sidebar-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

/* Card Header with Icon */
.xui-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 0;
}

.xui-widget-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #1e293b;
}

.xui-widget-header-icon svg {
    width: 100%;
    height: 100%;
}

.xui-widget-title {
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   1. XUI Blog Search Widget
   -------------------------------------------------------------------------- */
.xui-search-widget-form {
    position: relative;
    width: 100%;
}

.xui-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.xui-search-input-wrapper:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.xui-search-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #0052cc;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.xui-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xui-search-icon svg {
    width: 100%;
    height: 100%;
}

.xui-search-field {
    width: 100%;
    padding: 13px 16px 13px 42px !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
}

.xui-search-field::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   2. XUI Blog Categories Widget
   -------------------------------------------------------------------------- */
.xui-categories-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.xui-category-item {
    border-bottom: 1px solid #f1f5f9;
}

.xui-category-item:last-child {
    border-bottom: none;
}

.xui-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    text-decoration: none !important;
    color: #1e3a8a !important; /* Deep modern navy blue */
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.18s ease;
}

.xui-category-link:hover {
    color: #0052cc !important;
    transform: translateX(3px);
}

.xui-category-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.xui-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.xui-category-link:hover .xui-category-count {
    background: #e0e7ff;
    color: #0052cc;
}

/* --------------------------------------------------------------------------
   3. XUI Popular Posts Widget
   -------------------------------------------------------------------------- */
.xui-popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.xui-post-item {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.xui-post-item:hover {
    transform: translateY(-1px);
}

.xui-post-thumb-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    position: relative;
}

.xui-post-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.xui-post-item:hover .xui-post-thumb {
    transform: scale(1.08);
}

.xui-post-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex-grow: 1;
}

.xui-post-title {
    margin: 0 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #0f172a !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.18s ease;
}

.xui-post-item:hover .xui-post-title {
    color: #0052cc !important;
}

.xui-post-date {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   4. XUI Promo Banner Widget
   -------------------------------------------------------------------------- */
.xui-promo-banner-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    padding: 28px 24px;
    background-color: #080f1e;
    background-size: cover;
    background-position: center right;
    box-shadow: 0 8px 24px rgba(8, 15, 30, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 240px;
}

/* Fallback abstract tech gradient lines when no image is uploaded */
.xui-promo-banner-card.has-default-bg {
    background: linear-gradient(135deg, rgba(8, 15, 30, 0.95) 0%, rgba(15, 23, 42, 0.85) 100%),
                radial-gradient(ellipse at bottom right, rgba(0, 242, 254, 0.25) 0%, transparent 65%),
                repeating-linear-gradient(45deg, #0d1b2a 0, #0d1b2a 2px, #070e17 2px, #070e17 8px);
}

.xui-promo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 15, 30, 0.2) 0%, rgba(8, 15, 30, 0.85) 100%);
    pointer-events: none;
}

.xui-promo-content {
    position: relative;
    z-index: 2;
}

.xui-promo-subtitle {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #38bdf8; /* Teal / Cyan accent */
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.xui-promo-subtitle .xui-promo-accent {
    color: #00f2fe;
}

.xui-promo-title {
    margin: 0 0 10px !important;
    font-size: 21px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: #ffffff !important;
    letter-spacing: -0.02em;
}

.xui-promo-desc {
    margin: 0 0 20px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #cbd5e1 !important;
    font-weight: 400;
}

.xui-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #0f172a !important;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.22s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: fit-content;
}

.xui-promo-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    color: #0052cc !important;
}

.xui-promo-btn-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.xui-promo-btn:hover .xui-promo-btn-arrow {
    transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   5. XUI Newsletter Subscribe Widget
   -------------------------------------------------------------------------- */
.xui-newsletter-desc {
    margin: 0 0 16px !important;
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    color: #64748b !important;
}

.xui-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.xui-newsletter-input {
    width: 100% !important;
    padding: 12px 14px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    color: #0f172a !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

.xui-newsletter-input:focus {
    background: #ffffff !important;
    border-color: #0052cc !important;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1) !important;
}

.xui-newsletter-input::placeholder {
    color: #94a3b8;
}

.xui-newsletter-submit {
    width: 100% !important;
    padding: 12px !important;
    background: #0b132b !important; /* Premium deep navy */
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.xui-newsletter-submit:hover {
    background: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 19, 43, 0.15);
}

.xui-newsletter-disclaimer {
    margin: 10px 0 0 !important;
    font-size: 11.5px !important;
    color: #94a3b8 !important;
    text-align: left;
}

.xui-newsletter-message {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: none;
}

.xui-newsletter-message.is-success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.xui-newsletter-message.is-error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
