/* assets/frontend.css */

/* --- CORE LAYOUT --- */
.cohsar-tabs-wrap { 
    display: block; 
    width: 100%; 
    margin-bottom: 20px; 
    position: relative; 
    /* Important: Smooth padding transition for sticky spacer */
    transition: padding-top 0.1s linear; 
}

/* Base Nav: Defaults to Left Align + Scrollable (Sliding) */
.cohsar-tabs-nav { 
    display: flex; 
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0; 
    margin-bottom: 0; 
    background: #fff; 
    justify-content: flex-start; /* Default: Left align */
    
    /* Removed 'transition: all' to stop flickering during resize */
    
    /* Hide Scrollbar */
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}
.cohsar-tabs-nav::-webkit-scrollbar { display: none; }

/* SMART ALIGNMENT: JS adds this if tabs fit on screen */
.cohsar-tabs-nav.cohsar-all-fit {
    justify-content: center;
}

.cohsar-tab-btn { 
    cursor: pointer; 
    border: none; 
    font-family: inherit; 
    font-size: 14px; 
    flex: 0 0 auto;
    white-space: nowrap;
    transition: background 0.3s ease, color 0.3s ease; /* Only animate colors */
}

.cohsar-tabs-content { position: relative; padding: 20px; }

/* --- STICKY MODE --- */
.cohsar-tabs-nav.cohsar-sticky-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    padding: 10px 0;
}

/* REMOVED the hardcoded margin-top rule. JS handles it now. */

/* --- FIX FOR HIDDEN CONTENT --- */
.cohsar-tab-panel { display: none !important; }
div.cohsar-tab-panel.active { display: block !important; animation: cohsarFade 0.4s ease; }
@keyframes cohsarFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- 10 PROFESSIONAL TAB STYLES --- */

/* Style 1: Classic Blue */
.style-1 .cohsar-tabs-nav { border-bottom: 2px solid #ddd; gap: 5px; }
.style-1 .cohsar-tab-btn { background: #f1f1f1; padding: 10px 20px; border-radius: 4px 4px 0 0; color: #555; font-weight: 600; }
.style-1 .cohsar-tab-btn.active { background: #2271b1; color: #fff; }
.style-1 .cohsar-tabs-content { border: 1px solid #ddd; border-top: none; background: #fff; }

/* Style 2: Minimal Underline */
.style-2 .cohsar-tabs-nav { border-bottom: 2px solid #eee; }
.style-2 .cohsar-tab-btn { background: transparent; padding: 12px 25px; color: #888; border-bottom: 2px solid transparent; font-weight: 600; }
.style-2 .cohsar-tab-btn:hover { color: #333; }
.style-2 .cohsar-tab-btn.active { color: #2271b1; border-bottom-color: #2271b1; }
.style-2 .cohsar-tabs-content { padding-top: 15px; border-top: none; }

/* Style 3: Rounded Pills */
.style-3 .cohsar-tabs-nav { gap: 10px; border: none; }
.style-3 .cohsar-tab-btn { background: #f4f4f4; padding: 8px 20px; border-radius: 20px; color: #666; font-weight: 600; }
.style-3 .cohsar-tab-btn.active { background: #2271b1; color: #fff; box-shadow: 0 4px 6px rgba(34,113,177,0.3); }

/* Style 4: Vertical Left */
@media (min-width: 768px) {
    .style-4 .cohsar-tabs-wrap { display: flex; gap: 0; border: 1px solid #ddd; }
    .style-4 .cohsar-tabs-nav { 
        flex-direction: column; width: 250px; 
        background: #f4f6f8; border-right: 1px solid #ddd; padding: 0;
        overflow-x: hidden; flex-wrap: wrap; justify-content: flex-start !important; 
    }
    .style-4 .cohsar-tab-btn { 
        text-align: left; border-bottom: 1px solid #e0e0e0; background: transparent; 
        padding: 15px 20px; color: #555; width: 100%; margin: 0;
    }
    .style-4 .cohsar-tab-btn:hover { background: #eaeaea; }
    .style-4 .cohsar-tab-btn.active { 
        background: #fff; color: #2271b1; font-weight: bold; box-shadow: -4px 0 0 #2271b1 inset;
    }
    .style-4 .cohsar-tabs-content { flex: 1; border: none; padding: 30px; background: #fff; }
}

/* Style 5: Boxed & Attached */
.style-5 .cohsar-tabs-wrap { border: 1px solid #e5e5e5; border-radius: 4px; overflow: hidden; }
.style-5 .cohsar-tabs-nav { background: #f7f7f7; border-bottom: 1px solid #e5e5e5; }
.style-5 .cohsar-tab-btn { background: transparent; padding: 15px 25px; border-right: 1px solid #e5e5e5; color: #555; font-weight: bold; }
.style-5 .cohsar-tab-btn.active { background: #fff; color: #2271b1; box-shadow: 0 -2px 0 #2271b1 inset; }

/* Style 6: Dark Mode */
.style-6 .cohsar-tabs-nav { background: #222; padding: 5px; border-radius: 6px; display: inline-flex; }
.style-6 .cohsar-tab-btn { background: transparent; color: #aaa; padding: 8px 20px; border-radius: 4px; }
.style-6 .cohsar-tab-btn.active { background: #444; color: #fff; }
.style-6 .cohsar-tabs-content { background: #f9f9f9; padding: 20px; border-radius: 6px; margin-top: 10px; }

/* Style 7: Soft Gradient */
.style-7 .cohsar-tabs-nav { gap: 5px; }
.style-7 .cohsar-tab-btn { background: #fff; border: 1px solid #eee; padding: 10px 25px; border-radius: 30px; color: #555; }
.style-7 .cohsar-tab-btn.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border-color: transparent; }

/* Style 8: Clean Border */
.style-8 .cohsar-tabs-nav { border-bottom: 1px solid #ddd; }
.style-8 .cohsar-tab-btn { background: #fff; border: 1px solid #ddd; border-bottom: none; margin-right: 5px; padding: 10px 20px; border-radius: 4px 4px 0 0; top: 1px; position: relative; }
.style-8 .cohsar-tab-btn.active { border-top: 2px solid #2271b1; color: #2271b1; padding-bottom: 11px; z-index: 2; }

/* Style 9: Floating Cards */
.style-9 .cohsar-tabs-nav { gap: 15px; margin-bottom: 15px; }
.style-9 .cohsar-tab-btn { background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); padding: 12px 25px; border-radius: 4px; color: #555; }
.style-9 .cohsar-tab-btn.active { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(34,113,177,0.25); color: #2271b1; font-weight: bold; }

/* Style 10: Folder Tabs */
.style-10 .cohsar-tabs-nav { align-items: flex-end; padding-left: 10px; }
.style-10 .cohsar-tab-btn { 
    background: #f0f0f0; color: #666; padding: 10px 30px; border-radius: 8px 8px 0 0; 
    margin-right: -10px; z-index: 1; border: 1px solid #ccc; position: relative; 
}
.style-10 .cohsar-tab-btn.active { 
    background: #fff; z-index: 2; border-bottom: 1px solid #fff; margin-bottom: -1px;
    color: #000; font-weight: bold; box-shadow: 0 -2px 3px rgba(0,0,0,0.05);
}
.style-10 .cohsar-tabs-content { border: 1px solid #ccc; background: #fff; border-radius: 4px; z-index: 1; }

/* --- COLUMNS: CSS GRID LAYOUT --- */
.cohsar-cols-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    margin-bottom: 20px;
}
.cohsar-col-item {
    background: #fff; padding: 20px; box-sizing: border-box; display: block; width: auto; min-width: 0; 
}
.cohsar-col-title { margin: 0 0 15px; font-size: 1.25rem; border-bottom: 2px solid #eee; padding-bottom: 8px; }

@media(max-width:768px) {
    .cohsar-cols-wrap { grid-template-columns: 1fr; gap: 20px; }
    .cohsar-col-item { width: 100%; }
}