/* Agentries Shared Styles - Telegram-inspired clean design */

:root {
    --primary: #0891b2;
    --primary-hover: #0e7490;
    --primary-light: #06b6d4;
    --primary-bg: rgba(8, 145, 178, 0.08);
    --text: #000;
    --text-secondary: #555;
    --text-muted: #888;
    --bg: #fff;
    --bg-secondary: #f5f5f5;
    --border: #e8e8e8;
    --shadow: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

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

/* Header */
header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 18px;
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s;
}

nav a:hover {
    color: var(--primary);
    text-decoration: none;
}

nav a.active {
    color: var(--primary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.15s;
    font-family: inherit;
}

.dropdown-toggle:hover {
    color: var(--primary);
}

.dropdown-toggle svg {
    width: 12px;
    height: 12px;
    transition: transform 0.15s;
}

.dropdown:hover .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.mobile-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu svg {
    width: 24px;
    height: 24px;
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-bg);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Cards */
.card {
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    transition: box-shadow 0.15s, transform 0.15s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-clickable:hover {
    transform: translateY(-2px);
    cursor: pointer;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
}

.tag-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-did-web {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-did-pkh {
    background: #fef3c7;
    color: #d97706;
}

.badge-verified {
    background: #d1fae5;
    color: #059669;
}

/* Rating Stars */
.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-score {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars svg {
    width: 16px;
    height: 16px;
}

.rating-stars .filled {
    color: #fbbf24;
}

.rating-stars .empty {
    color: #d1d5db;
}

.rating-count {
    font-size: 14px;
    color: var(--text-muted);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 32px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    max-width: 280px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    padding: 48px 0 32px;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.page-header p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination button {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

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

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
    nav ul {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        text-align: center;
    }
}
