/**
 * Multisite CCT Aggregator - Research Projects
 * Version: 6.0 - Live Search Dropdown & Tombol di Kanan
 */

/* ===== Container ===== */
.cct-research-container,
.cct-trg-container,
.cct-search-container,
.cct-all-projects-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== Typography ===== */
.cct-research-title,
.cct-trg-title,
.cct-search-title {
    font-size: 32px !important;
    margin: 0 0 15px 0 !important;
    color: #1a1a1a !important;
    border-bottom: 3px solid #0073aa !important;
    padding: 0 0 12px 0 !important;
    font-weight: 600 !important;
}

.cct-research-count {
    color: #666 !important;
    margin: 0 0 25px 0 !important;
    font-size: 16px !important;
    font-style: italic !important;
}

/* ===== Grid Layout ===== */
.cct-research-grid {
    display: grid;
    gap: 25px;
    margin: 20px 0 0 0;
}

.cct-grid-2cols { grid-template-columns: repeat(2, 1fr); }
.cct-grid-3cols { grid-template-columns: repeat(3, 1fr); }
.cct-grid-4cols { grid-template-columns: repeat(4, 1fr); }

/* ===== Card Styling ===== */
.cct-research-card {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

.cct-research-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(0,115,170,0.15) !important;
    border-color: #0073aa !important;
}

/* Card Image */
.cct-card-image {
    height: 160px !important;
    overflow: hidden !important;
}

.cct-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
}

.cct-research-card:hover .cct-card-image img {
    transform: scale(1.05) !important;
}

/* Card Content - Flexbox Layout */
.cct-card-content {
    padding: 15px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Header Section */
.cct-card-header {
    margin-bottom: 10px !important;
}

.cct-card-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 0 8px 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px dashed #e0e0e0 !important;
    font-size: 12px !important;
}

.cct-card-source {
    color: #0073aa !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

.cct-card-source a {
    color: #0073aa !important;
    text-decoration: none !important;
}

.cct-card-source a:hover {
    text-decoration: underline !important;
}

.cct-card-date {
    color: #888 !important;
    font-size: 11px !important;
}

.cct-card-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.cct-card-title a {
    color: #1a1a1a !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.cct-card-title a:hover {
    color: #0073aa !important;
}

/* Body Section - Takes remaining space */
.cct-card-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.cct-card-description {
    color: #555 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.cct-card-trg {
    margin: 0 !important;
}

.cct-trg-badge {
    display: inline-block !important;
    background: #f0f7ff !important;
    color: #0073aa !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(0,115,170,0.2) !important;
}

/* Footer Section - Tombol di Sebelah KANAN */
.cct-card-footer {
    margin-top: 15px !important;
    padding-top: 10px !important;
    border-top: 1px dashed #e0e0e0 !important;
    text-align: right !important;
}

.cct-card-button {
    display: inline-block !important;
    width: auto !important;
    min-width: 100px !important;
    background: #0073aa !important;
    color: #ffffff !important;
    padding: 6px 15px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
}

.cct-card-button:hover {
    background: #005a87 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

/* ===== LIVE SEARCH DROPDOWN STYLES ===== */
.cct-live-search-container {
    position: relative;
    width: 100%;
}

.cct-live-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.cct-live-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
    outline: none;
}

.cct-live-search-input::placeholder {
    color: #aaa;
    font-style: italic;
}

.cct-live-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 2px;
    animation: cct-fadeIn 0.2s ease-out;
}

.cct-live-result-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    font-size: 14px;
}

.cct-live-result-item:last-child {
    border-bottom: none;
}

.cct-live-result-item:hover {
    background: #f0f7ff !important;
}

.cct-live-result-item.selected {
    background: #e1f0ff;
    color: #0073aa;
    font-weight: 500;
    border-left: 3px solid #0073aa;
}

.cct-live-no-results {
    padding: 15px;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* Scrollbar styling */
.cct-live-results::-webkit-scrollbar {
    width: 8px;
}

.cct-live-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cct-live-results::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 4px;
}

.cct-live-results::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

/* ===== Search Section ===== */
.cct-search-section,
.cct-filter-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 25px 0;
}

.cct-search-form,
.cct-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.cct-search-box {
    flex: 2;
    min-width: 300px;
    display: flex;
    gap: 8px;
}

.cct-search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cct-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.cct-search-button {
    padding: 10px 20px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.cct-search-button:hover {
    background: #005a87;
}

.cct-filter-box {
    flex: 1;
    min-width: 250px;
}

.cct-filter-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.cct-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    display: none; /* Hidden, diganti dengan live search */
}

.cct-dropdown-hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 11px;
    font-style: italic;
}

.cct-reset-button {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.cct-reset-button:hover {
    background: #545b62;
    color: #ffffff;
}

.cct-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cct-filter-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.cct-button-primary {
    background: #0073aa;
    color: #ffffff;
}

.cct-button-primary:hover {
    background: #005a87;
    color: #ffffff;
}

.cct-button-secondary {
    background: #6c757d;
    color: #ffffff;
}

.cct-button-secondary:hover {
    background: #545b62;
    color: #ffffff;
}

/* ===== Results Summary ===== */
.cct-results-summary {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    padding: 12px 18px;
    margin: 0 0 20px 0;
    border-radius: 0 4px 4px 0;
}

.cct-results-summary p {
    margin: 5px 0;
    color: #333;
    font-size: 14px;
}

.cct-results-summary strong {
    color: #0073aa;
}

/* ===== No Results ===== */
.cct-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* ===== Highlight ===== */
.cct-card-description mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
}

/* ===== Pagination ===== */
.cct-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0 0 0;
    flex-wrap: wrap;
}

.cct-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    background: #ffffff;
}

.cct-page-link:hover {
    background: #f0f0f0;
    border-color: #aaa;
}

.cct-page-link.active {
    background: #0073aa;
    color: #ffffff;
    border-color: #0073aa;
}

/* ===== List View ===== */
.cct-research-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cct-research-item {
    display: flex;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.cct-research-image {
    flex: 0 0 200px;
}

.cct-research-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cct-research-content {
    flex: 1;
    padding: 20px;
}

.cct-research-meta {
    display: flex;
    gap: 15px;
    margin: 0 0 10px 0;
    font-size: 13px;
}

.cct-research-source a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.cct-research-date {
    color: #888;
}

.cct-research-item-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.cct-research-item-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.cct-research-description {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.cct-research-trg {
    margin: 0 0 15px 0;
}

.cct-trg-label {
    font-weight: 600;
    color: #444;
    font-size: 13px;
    margin-right: 8px;
}

.cct-trg-value {
    background: #f0f7ff;
    color: #0073aa;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.cct-research-readmore {
    text-align: right;
    margin: 10px 0 0 0;
}

.cct-research-readmore a {
    display: inline-block;
    background: #0073aa;
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.cct-research-readmore a:hover {
    background: #005a87;
}

/* ===== TRG List ===== */
.cct-trg-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.cct-trg-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
}

.cct-trg-card-title {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #333;
    border-left: 3px solid #0073aa;
    padding-left: 12px;
}

.cct-trg-stats {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 13px;
}

.cct-trg-sites {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    font-size: 12px;
    color: #555;
}

.cct-trg-sites li {
    padding: 5px 0;
    border-bottom: 1px dashed #eaeaea;
}

.cct-trg-button {
    display: inline-block;
    background: #0073aa;
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
}

.cct-trg-button:hover {
    background: #005a87;
    color: #ffffff;
}

/* ===== Animations ===== */
@keyframes cct-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .cct-grid-3cols,
    .cct-grid-4cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cct-research-title {
        font-size: 24px;
    }
    
    .cct-grid-2cols,
    .cct-grid-3cols,
    .cct-grid-4cols {
        grid-template-columns: 1fr;
    }
    
    .cct-search-form,
    .cct-filter-form {
        flex-direction: column;
    }
    
    .cct-search-box {
        flex-direction: column;
        width: 100%;
    }
    
    .cct-filter-box {
        width: 100%;
    }
    
    .cct-card-button {
        width: 100% !important;
    }
    
    .cct-research-item {
        flex-direction: column;
    }
    
    .cct-research-image {
        flex: 0 0 200px;
    }
    
    .cct-card-footer {
        text-align: center !important;
    }
    
    .cct-live-results {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .cct-research-title {
        font-size: 20px;
    }
    
    .cct-card-image {
        height: 140px;
    }
    
    .cct-live-search-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .cct-live-result-item {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ===== Results Summary dengan Hint ===== */
.cct-results-summary {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    padding: 15px 20px;
    margin: 0 0 25px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cct-results-summary p {
    margin: 8px 0;
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.5;
}

.cct-results-summary strong {
    color: #0073aa;
    font-weight: 700;
    font-size: 16px;
}

.cct-summary-hint {
    color: #6c757d !important;
    font-size: 13px !important;
    font-style: italic;
    margin-top: 5px !important;
    padding-top: 5px;
    border-top: 1px dashed #b8daff;
}

/* Ikon untuk hint */
.cct-summary-hint::before {
    content: "💡 ";
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .cct-results-summary {
        padding: 12px 15px;
    }
    
    .cct-results-summary p {
        font-size: 14px;
    }
    
    .cct-summary-hint {
        font-size: 12px !important;
    }
}