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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: #1f2937;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    margin-bottom: 40px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-nav .nav-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.header-nav .nav-link:hover {
    background: #f3f4f6;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
}

.logo h1 {
    font-size: 1.8rem;
    color: #1f2937;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.separator {
    color: #9ca3af;
}

main h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #1f2937;
}

.search-filter-bar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-box {
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.search-box input::placeholder {
    color: #9ca3af;
}

.results-count {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 16px;
    padding-left: 4px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filters label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.role-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.role-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.role-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}

.tool-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

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

.tool-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-status {
    width: 32px;
    height: 32px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #1f2937;
    line-height: 1.3;
}

.card-rating {
    margin-bottom: 8px;
}

.stars {
    color: #f59e0b;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.card-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tier-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.tier-badge.tier-tier-1 {
    background: #d1fae5;
    color: #065f46;
}

.tier-badge.tier-tier-2 {
    background: #fef3c7;
    color: #92400e;
}

.tier-badge.tier-tier-3 {
    background: #fee2e2;
    color: #991b1b;
}

.primary-role-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 12px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 8px;
}

/* Credit Cost Badges */
.credit-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.credit-badge.credit-low {
    background: #d1fae5;
    color: #065f46;
}

.credit-badge.credit-medium {
    background: #fef3c7;
    color: #92400e;
}

.credit-badge.credit-high {
    background: #fee2e2;
    color: #991b1b;
}

.card-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.btn-details {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-details:hover {
    background: #667eea;
    color: white;
}

.tool-type {
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #1f2937;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}

.back-link:hover {
    opacity: 0.9;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.error {
    grid-column: 1 / -1;
    text-align: center;
    color: #ef4444;
    padding: 40px;
}

footer {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.modal {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 20px;
}

.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #1f2937;
}

.modal-rating {
    margin-bottom: 16px;
}

.modal-description {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.meta-type, .meta-category {
    font-size: 0.85rem;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    color: #6b7280;
}

.modal-badges {
    margin-bottom: 20px;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.badge-group strong {
    color: #6b7280;
    font-weight: 500;
}

.role-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 12px;
}

.suite-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: #f3e8ff;
    color: #7c3aed;
    border-radius: 12px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    padding: 14px 24px;
    background: #f0f4ff;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    background: #e0e8ff;
}

.btn-primary {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.btn-tour {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-tour:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-start-tour {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none !important;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn-start-tour:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a67d8 0%, #6b2fb8 100%);
}

.btn-start-tour:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    main h2 {
        font-size: 1.4rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .role-filters {
        width: 100%;
    }
    
    .role-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .modal {
        padding: 24px;
    }
}

/* B|CHAT Link Styling */
.bchat-link {
    background: linear-gradient(135deg, #00d4aa, #00a884) !important;
    color: white !important;
}
