/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.header-content {
    text-align: center;
}

.site-title {
    margin-bottom: 1rem;
}

.title-main {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.title-sub {
    display: block;
    font-size: 1.2rem;
    font-weight: 400;
    color: #667eea;
}

.site-description {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.header-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.home-link, .github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.home-link:hover, .github-link:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: #2d3748;
}

/* Main content */
.main {
    padding-bottom: 4rem;
}

/* Controls */
.controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #5a67d8;
}

.filter-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Stats */
.stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.stat-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Agent grid */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.agent-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.agent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 2px solid #e2e8f0;
}

.agent-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.agent-description {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.agent-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #718096;
}

.agent-category {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.agent-date {
    font-weight: 500;
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination button:hover {
    border-color: #667eea;
    color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.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: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
}

.agent-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.agent-meta {
    flex: 1;
}

.agent-meta h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.agent-meta p {
    margin: 0.75rem 0 1rem 0;
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
}

.category-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #667eea;
    color: white;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.prompt-section h3 {
    margin: 0 0 1.25rem 0;
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.prompt-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.prompt-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.copy-btn, .source-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.copy-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.source-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.source-btn:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer a {
    color: #a8c8ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

.footer-note {
    margin-top: 0.5rem;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .site-title .title-main {
        font-size: 2rem;
    }
    
    .site-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .header-links {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .home-link, .github-link {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    .search-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }

    .search-input {
        width: 100%;
        margin-bottom: 0;
    }

    .search-button {
        width: 100%;
    }

    .filter-container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .category-filter {
        width: 100%;
    }

    .agent-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .agent-card {
        padding: 1.25rem;
    }

    .agent-name {
        font-size: 1.1rem;
    }

    .agent-description {
        font-size: 0.9rem;
    }

    /* Modal responsive improvements */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .agent-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-avatar {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .agent-meta h2 {
        font-size: 1.3rem;
    }
    
    .prompt-content {
        padding: 1.25rem;
        font-size: 0.85rem;
        max-height: 250px;
    }
    
    .prompt-actions {
        flex-direction: column;
    }
    
    .copy-btn, .source-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }

    .pagination button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .site-title .title-main {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .site-description {
        font-size: 0.95rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 0.5rem auto;
    }
    
    .modal-header {
        padding: 0.875rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .prompt-content {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Import better fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
