* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #00a1e0 0%, #0070d2 100%);
    color: white;
    padding: 30px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.header-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    padding: 8px;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.controls-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.controls-row--with-stats {
    align-items: center;
}

.controls-row--with-stats .stats {
    margin-left: auto;
}

.stats.and-sort {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.sort-inline {
    min-width: 180px;
}

.actions-group {
    display: flex;
    gap: 8px;
    align-self: end;
}

.favorite-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.favorite-control .star {
    color: #ffb703;
    font-size: 16px;
}

.favorite-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Switch styling for favoritesOnly checkbox */
.favorite-switch input[type="checkbox"] {
    appearance: none;
    width: 36px;
    height: 20px;
    background: #e9ecef;
    border-radius: 999px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    border: 1px solid #d9dee3;
}

.favorite-switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out;
}

.favorite-switch input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #00a1e0 0%, #0070d2 100%);
    border-color: #0070d2;
}

.favorite-switch input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.switch-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

/* Chips panel placed within the stats row area */
.chips-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px; /* fixed width to avoid pushing layout */
    width: 100%;
}

.chips-group {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
}

.chips-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
}

.action-btn {
    background: #0070d2;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none; /* ensure anchors with this class have no underline */
}

.action-btn.secondary {
    background: #f1f3f5;
    color: #2c3e50;
}

.action-btn.docs {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: #fff;
    text-decoration: none;
}

.action-btn.docs:hover {
    filter: brightness(1.05);
    text-decoration: none;
}

.action-btn:hover {
    opacity: 0.9;
}

.control-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.controls-row--with-stats .control-group {
    min-width: 180px;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 4px;
    color: #495057;
    font-size: 13px;
}

.control-group select,
.control-group input {
    padding: 6px 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #0070d2;
}

/* Chips rows under inputs */
.chips-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
    max-height: 52px;
    overflow-y: auto;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e9f5ff;
    color: #0b5fad;
    border: 1px solid #cfe8ff;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
}

.chip-remove {
    appearance: none;
    border: none;
    background: transparent;
    color: #0b5fad;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}

.chip-remove:hover {
    color: #063d6f;
}

.search-box {
    flex: 1;
    min-width: 240px;
}

.stats {
    display: flex;
    gap: 20px;
    margin-top: 0;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #0070d2;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
}

.features-container {
    padding: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.feature-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.feature-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    flex: 1;
}

.feature-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.favorite-btn {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    color: #ffb703; /* gold */
    padding: 0 2px;
}

.favorite-btn:is(:hover, :focus) {
    transform: scale(1.1);
}

.favorite-btn.is-favorited {
    color: #ff9900;
    
}

.favorite-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-label {
    font-weight: 500;
    color: #495057;
}

.feature-type.ga {
    background: #d4edda;
    color: #155724;
}

.feature-type.beta {
    background: #fff3cd;
    color: #856404;
}

.feature-category {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.feature-description {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 15px;
}

.feature-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.impact-stars {
    font-size: 14px;
    line-height: 1;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
}

.cloud-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.meta-products {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.cloud-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cloud-platform {
    background: #e3f2fd;
    color: #1565c0;
}

.cloud-sales-cloud {
    background: #e8f5e8;
    color: #2e7d32;
}

.cloud-field-service {
    background: #fff3e0;
    color: #ef6c00;
}

.cloud-service {
    background: #f3e5f5;
    color: #7b1fa2;
}

.cloud-experience-cloud {
    background: #e0f2f1;
    color: #00695c;
}

.cloud-other {
    background: #fafafa;
    color: #616161;
}

/* Additional badge styles for requested categories */
.cloud-industry {
    background: #e8eaf6;
    color: #3949ab;
}

.cloud-analytics {
    background: #fff8e1;
    color: #f9a825;
}

.cloud-marketing {
    background: #fce4ec;
    color: #c2185b;
}

.cloud-data-cloud {
    background: #e1f5fe;
    color: #0277bd;
}

.cloud-mulesoft {
    background: #e0f7fa;
    color: #00838f;
}

.cloud-heroku {
    background: #f3e5f5;
    color: #6a1b9a;
}

.cloud-revenue-cloud {
    background: #ede7f6;
    color: #5e35b1;
}

.cloud-slack {
    background: #e8f5e9;
    color: #2e7d32;
}

.cloud-commerce {
    background: #f1f8e9;
    color: #558b2f;
}

.view-details-btn {
    background: linear-gradient(135deg, #0070d2 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    margin-top: auto; /* anchor to bottom of the card */
}

.view-details-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #0070d2 0%, #0056b3 100%);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 300;
}

.close {
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    color: #0070d2;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.detail-section p {
    line-height: 1.6;
    color: #495057;
}

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

.benefits-list li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #495057;
}

.benefits-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-results h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        min-width: auto;
    }
    
    .search-box {
        min-width: auto;
    }
}

