/**
 * Tools Showcase - Simple Working Design
 */

/* Container */
.ts-showcase-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* HORIZONTAL CATEGORY MENU */
.ts-tab-nav-wrapper {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 40px;
}

.ts-tab-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px;
    align-items: center;
}

/* Hide br/p tags as fallback if PHP filter doesn't catch them */
.ts-tab-nav br,
.ts-tab-btn br {
    display: none !important;
}

.ts-tab-nav p {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tab buttons - Override ALL Elementor styles */
.ts-tab-nav .ts-tab-btn,
button.ts-tab-btn,
.elementor-shortcode button.ts-tab-btn {
    /* Reset Elementor defaults */
    all: unset;
    box-sizing: border-box;
    
    /* Our custom styling */
    padding: 8px 16px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    text-align: center !important;
    
    /* Remove any Elementor spacing */
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    max-width: none !important;
    max-height: none !important;
}

/* Hover state */
.ts-tab-nav .ts-tab-btn:hover,
button.ts-tab-btn:hover,
.elementor-shortcode button.ts-tab-btn:hover {
    background: #e9ecef !important;
    border-color: #ced4da !important;
    color: #212529 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

/* Active state */
.ts-tab-nav .ts-tab-btn.active,
button.ts-tab-btn.active,
.elementor-shortcode button.ts-tab-btn.active {
    background: #0C1446 !important;
    border-color: #0C1446 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(12, 20, 70, 0.25) !important;
}

/* Active hover state */
.ts-tab-nav .ts-tab-btn.active:hover,
button.ts-tab-btn.active:hover,
.elementor-shortcode button.ts-tab-btn.active:hover {
    background: #0A1033 !important;
    border-color: #08091F !important;
    transform: translateY(-1px) !important;
}

/* Grid */
.ts-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Cards - Equal height with buttons at bottom */
.ts-tool-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.ts-tool-card:hover {
    border-color: #2c5f8d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ts-tool-card.featured {
    grid-column: span 2;
}

.ts-tool-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #f5f5f5;
}

.ts-tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ts-tool-icon {
    width: 64px;
    height: 64px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 16px;
}

.ts-tool-category {
    display: inline-block;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* Tool card title - Override Elementor */
.ts-tool-card .ts-tool-title,
.ts-tool-title,
h3.ts-tool-title {
    all: unset;
    display: block !important;
    
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #212529 !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    
    width: auto !important;
    padding: 0 !important;
}

.ts-tool-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.ts-tool-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

.ts-tool-footer {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* Vote button on cards - Override Elementor */
.ts-tool-footer .ts-vote-btn,
button.ts-vote-btn,
.elementor-shortcode button.ts-vote-btn {
    all: unset;
    box-sizing: border-box;
    
    padding: 8px 12px !important;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6c757d !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    margin: 0 !important;
}

.ts-tool-footer .ts-vote-btn:hover,
button.ts-vote-btn:hover {
    background: #fff5f5 !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.15) !important;
}

.ts-tool-footer .ts-vote-btn.voted,
button.ts-vote-btn.voted {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.ts-tool-footer .ts-vote-btn.voted:hover,
button.ts-vote-btn.voted:hover {
    background: #bb2d3b !important;
    border-color: #b02a37 !important;
}

/* Details button on cards - Override Elementor */
.ts-tool-footer .ts-details-btn,
button.ts-details-btn,
.elementor-shortcode button.ts-details-btn {
    all: unset;
    box-sizing: border-box;
    
    flex: 1 !important;
    padding: 8px 16px !important;
    background: #0C1446 !important;
    border: 1px solid #0C1446 !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    display: block !important;
    
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    margin: 0 !important;
}

.ts-tool-footer .ts-details-btn:hover,
button.ts-details-btn:hover {
    background: #0A1033 !important;
    border-color: #08091F !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(12, 20, 70, 0.25) !important;
}

/* Side Panel */
.ts-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.ts-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ts-side-panel {
    position: fixed;
    right: -650px;
    top: 0;
    width: 90%;
    max-width: 600px;
    height: 100%;
    background: white;
    z-index: 1001;
    overflow-y: auto;
    transition: right 0.3s;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.ts-side-panel.active {
    right: 0;
}

.ts-panel-header {
    padding: 32px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

/* Panel close button - Override Elementor */
.ts-panel-close,
button.ts-panel-close,
#tsPanelClose {
    all: unset;
    box-sizing: border-box;
    
    position: absolute !important;
    top: 24px !important;
    right: 24px !important;
    width: 36px !important;
    height: 36px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #495057 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1 !important;
    text-decoration: none !important;
    
    min-width: unset !important;
    min-height: unset !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ts-panel-close:hover,
button.ts-panel-close:hover,
#tsPanelClose:hover {
    background: #212529 !important;
    border-color: #212529 !important;
    color: #ffffff !important;
    transform: scale(1.05) !important;
}

.ts-panel-icon {
    width: 72px;
    height: 72px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* Panel header title - Override Elementor */
.ts-panel-header h2,
#tsPanelTitle,
.ts-side-panel h2 {
    all: unset;
    display: block !important;
    
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #212529 !important;
    margin-bottom: 16px !important;
    line-height: 1.3 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    
    width: auto !important;
    padding: 0 !important;
}

.ts-panel-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ts-panel-category {
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.ts-panel-content {
    padding: 32px;
}

.ts-panel-loading {
    text-align: center;
    padding: 60px 20px;
}

.ts-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #2c5f8d;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ts-panel-section {
    margin-bottom: 32px;
}

/* Panel section headings - Override Elementor */
.ts-panel-section h3,
.ts-side-panel h3 {
    all: unset;
    display: block !important;
    
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #212529 !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    
    width: auto !important;
    padding: 0 !important;
}

.ts-panel-section p {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 12px;
}

.ts-benefits-list {
    list-style: none;
    padding: 0;
}

.ts-benefits-list li {
    padding: 12px 0 12px 28px;
    position: relative;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    color: #0C1446;
}

.ts-benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 12px;
    color: #0C1446;
    font-weight: 700;
}

.ts-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.ts-stat-card {
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
}

.ts-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ts-stat-label {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
}

.ts-panel-cta {
    display: flex;
    gap: 12px;
    padding: 24px 32px;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    background: white;
}

/* Panel CTA buttons - Override Elementor */
.ts-panel-cta .ts-btn-vote,
.ts-panel-cta .ts-btn-contact,
button.ts-btn-vote,
button.ts-btn-contact,
#tsPanelVoteBtn {
    all: unset;
    box-sizing: border-box;
    
    flex: 1 !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    display: block !important;
    
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    margin: 0 !important;
}

.ts-panel-cta .ts-btn-vote,
button.ts-btn-vote,
#tsPanelVoteBtn {
    background: #ffffff !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
}

.ts-panel-cta .ts-btn-vote:hover,
button.ts-btn-vote:hover,
#tsPanelVoteBtn:hover {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25) !important;
}

.ts-panel-cta .ts-btn-contact,
button.ts-btn-contact {
    background: #0C1446 !important;
    border: 1px solid #0C1446 !important;
    color: #ffffff !important;
}

.ts-panel-cta .ts-btn-contact:hover,
button.ts-btn-contact:hover {
    background: #0A1033 !important;
    border-color: #08091F !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(12, 20, 70, 0.25) !important;
}

/* Vote Modal */
.ts-vote-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.ts-vote-modal.active {
    opacity: 1;
    visibility: visible;
}

.ts-vote-modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 460px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Vote modal close button - Override Elementor */
.ts-vote-modal-close,
button.ts-vote-modal-close,
#tsVoteModalClose {
    all: unset;
    box-sizing: border-box;
    
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    width: 32px !important;
    height: 32px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #495057 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1 !important;
    text-decoration: none !important;
    
    min-width: unset !important;
    min-height: unset !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ts-vote-modal-close:hover,
button.ts-vote-modal-close:hover,
#tsVoteModalClose:hover {
    background: #212529 !important;
    border-color: #212529 !important;
    color: #ffffff !important;
}

.ts-vote-modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ts-vote-modal-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

#tsVoteForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#tsVoteEmail {
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

#tsVoteEmail:focus {
    outline: none;
    border-color: #2c5f8d;
    background: white;
}

/* Vote submit button - Override Elementor */
.ts-vote-submit,
button.ts-vote-submit,
#tsVoteForm button[type="submit"] {
    all: unset;
    box-sizing: border-box;
    
    padding: 12px 24px !important;
    background: #0C1446 !important;
    border: 1px solid #0C1446 !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    margin: 0 !important;
}

.ts-vote-submit:hover,
button.ts-vote-submit:hover,
#tsVoteForm button[type="submit"]:hover {
    background: #0A1033 !important;
    border-color: #08091F !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(12, 20, 70, 0.25) !important;
}

.ts-vote-submit:disabled,
button.ts-vote-submit:disabled,
#tsVoteForm button[type="submit"]:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
    transform: none !important;
}

.ts-vote-message {
    display: none;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

.ts-vote-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.ts-vote-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

.ts-no-tools {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

/* Responsive */
@media (max-width: 1024px) {
    .ts-bento-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .ts-tool-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .ts-showcase-wrapper {
        padding: 30px 16px;
    }
    .ts-bento-grid {
        grid-template-columns: 1fr;
    }
    .ts-side-panel {
        width: 100%;
        max-width: 100%;
    }
    .ts-stats-grid {
        grid-template-columns: 1fr;
    }
    .ts-tool-footer,
    .ts-panel-cta {
        flex-direction: column;
    }
}

/* Read More Link */
.ts-read-more-link {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: transparent;
    color: #0C1446;
    border: 1px solid #0C1446;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ts-read-more-link:hover {
    background: #0C1446;
    color: white;
    text-decoration: none;
}

/* Update tool meta icons */
.ts-tool-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ts-tool-meta svg {
    opacity: 0.6;
}
