/* ============================================================
   KISAN SHORTCODES - FULL STYLESHEET
   ============================================================ */

/* --- 1. GLOBAL CARD & TEXT BASICS --- */
.kk-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.kk-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.kk-card-icon {
    font-size: 24px;
    background: #f8f9fa;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.kk-card-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #1a1a1a;
    margin: 0 !important;
}

.kk-card-desc {
    font-size: 13px !important;
    color: #666 !important;
    margin: 0 !important;
}

/* --- 2. LIST STYLES (Mandi, Forum) --- */
.kk-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.kk-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}

.kk-list li:last-child {
    border-bottom: none;
}

.kk-row-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.kk-row-meta {
    font-size: 12px;
    color: #888;
}

/* News Horizontal Scroller - FIXED WIDTH */
.kk-news-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: block; /* Ensures container stays in bounds */
}

.kk-news-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.kk-news-scroll-track {
    display: flex;
    gap: 12px;
    padding: 10px 5px;
    width: max-content; /* Allows cards to sit side-by-side */
}

.kk-news-item {
    /* FIX: Force the card to be 75% of the screen width so the next one shows */
    flex: 0 0 75vw !important; 
    width: 75vw !important;
    max-width: 280px; /* Limits size on bigger screens */
    
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eee;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevents text from stretching the card */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Optimized for 4:3 Images */
.kk-news-image-box {
    width: 100%;
    /* Matching your image ratio exactly */
    aspect-ratio: 4 / 3; 
    background: #f9f9f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kk-news-image-box img {
    width: 100%;
    height: 100%;
    /* 'cover' will now work perfectly without zooming too much 
       because the box and image share the same 4:3 ratio */
    object-fit: cover; 
    display: block;
}

/* Mobile Fix: Ensure the card doesn't get too tall */
@media (max-width: 480px) {
    .kk-news-item {
        flex: 0 0 75vw !important;
        width: 75vw !important;
    }
    
    .kk-news-image-box {
        aspect-ratio: 4 / 3; /* Keeps the 4:3 shape on mobile phones */
    }
}

.kk-news-info {
    padding: 12px;
    white-space: normal; /* Allows text to wrap instead of pushing width */
}

.kk-news-item-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0 0 5px 0;
    
    /* FIX: Force text to stay inside the card */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word; 
}

.kk-news-item-meta {
    font-size: 11px;
    color: #999;
}

/* --- 4. AUTO-SCROLLING SHOP SLIDER --- */
.kk-slider-area {
    overflow: hidden;
    width: 100%;
    padding: 15px 0;
    position: relative;
}

.kk-slider-track {
    display: flex;
    width: max-content;
    animation: scrollSlide 25s linear infinite;
}

.kk-slider-track:hover {
    animation-play-state: paused;
}

.kk-item {
    width: 160px;
    margin: 0 10px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.kk-item a { text-decoration: none !important; color: #333; display: block; }

.kk-img {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0;
    background-color: #f9f9f9;
}

.kk-details { padding: 10px; text-align: center; }

.kk-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.kk-price {
    color: #27ae60;
    font-weight: 800;
    font-size: 15px;
}

@keyframes scrollSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- 5. WEATHER CARD (PURPLE GRADIENT) --- */
.kk-weather-card {
    background: linear-gradient(135deg, #610db7 0%, #3b0975 100%);
    color: white;
    border: none;
}

.kk-weather-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#kk-area { margin: 0; font-size: 20px; font-weight: 700; color: white; }
#kk-cond-text { margin: 0; font-size: 14px; opacity: 0.9; color: white; }
#kk-temp-big { font-size: 42px; font-weight: 900; }
#kk-weather-icon { font-size: 38px; }

.kk-weather-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 12px;
}

.kk-stat-item { font-size: 12px; display: flex; flex-direction: column; color: white; }
.kk-stat-item b { font-size: 14px; margin-top: 2px; color: white; }

/* --- 6. BUTTONS & ACTIONS --- */
.kk-actions {
    margin-top: 15px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.kk-view {
    text-decoration: none !important;
    color: #610db7 !important;
    font-weight: 700;
    font-size: 14px;
    display: inline-block;
}

.kk-view-light {
    text-decoration: none !important;
    color: #fff !important;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-block;
}

/* --- 7. DASHBOARD GRID SYSTEM --- */
.kk-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.kk-full-width {
    grid-column: 1 / -1;
}

/* --- 8. MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .kk-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .kk-card { padding: 12px; }
    .kk-item { width: 140px; }
    .kk-img { height: 100px; }
    .kk-card-title { font-size: 16px !important; }
    .kk-news-item { flex: 0 0 85%; } /* Slightly wider cards on small screens */
}