@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'Nau-Sea';
    src: url('../fonts/Nau-Sea.ttf.woff') format('woff'),
        url('../fonts/Nau-Sea.ttf.svg#Nau-Sea') format('svg'),
        url('../fonts/Nau-Sea.ttf.eot'),
        url('../fonts/Nau-Sea.eot?#iefix') format('embedded-opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: rgb(9, 9, 11);
    --accent: rgb(183, 255, 0);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border: #374151;
}

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

body {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Typography */
h1 {
    font-family: 'Nau-Sea', sans-serif;
    font-size: 2.5rem;
    font-weight: normal;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Layout */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header .top-bar {
    justify-content: center;
    margin-bottom: 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #a0d400;
}

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 12px;
}

/* Lists */
.list-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.list-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: rgba(183, 255, 0, 0.05);
}

.item-info h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.item-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(183, 255, 0, 0.2);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

/* Search */
.search-dropdown {
    position: relative;
    width: 500px;
    max-width: 100%;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
}

.search-input-group .form-control {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border-right: none;
    flex: 1;
}

.search-btn {
    border-radius: 0;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    border-left: 1px solid var(--accent);
}

.search-btn:hover {
    background: #a0d400;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.dropdown-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: rgba(183, 255, 0, 0.1);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.game-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.user-btn:hover {
    background: var(--bg-secondary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 150px;
    display: none;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: rgba(183, 255, 0, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 50px auto;
    max-width: 800px;
    border-radius: 12px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
}

.close:hover {
    color: var(--text-primary);
}

/* Developer Modal Specific */
.modal-creator-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border);
    position: relative;
}

.modal-creator-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.modal-creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-creator-details h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.modal-creator-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.modal-stat {
    background: rgba(183, 255, 0, 0.1);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(183, 255, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Modal Games Grid */
.modal-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.game-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(183, 255, 0, 0.1);
    transform: translateY(-2px);
}

.game-card-image {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: linear-gradient(135deg, #333, #555);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.game-card:hover .game-card-image {
    border-color: var(--accent);
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-icon {
    font-size: 24px;
    color: var(--accent);
}

.game-card-info h5 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    word-break: break-word;
}

.game-card-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.game-stat {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    text-align: center;
}

.game-plays {
    background: rgba(183, 255, 0, 0.1);
    color: var(--accent);
    border-color: rgba(183, 255, 0, 0.3);
    font-weight: 600;
}

/* Modal Loading State */
.modal-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        max-width: none;
    }

    .modal-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .game-card {
        padding: 0.75rem;
    }

    .game-card-image {
        width: 50px;
        height: 50px;
    }

    .modal-creator-info {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .modal-creator-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Description Section */
.description {
    text-align: center;
    margin-bottom: 2rem;
}

.description p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.logo {
    width: 40px;
    height: 40px;
    background: url('../images/remix-logo.svg') no-repeat center center;
    background-size: contain;
}

/* Creator Cards */
.creators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Limit search result cards to 25% width on larger screens */
.search-results .creators-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, min(25%, 300px)));
    justify-content: center;
}

.creator-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.creator-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(183, 255, 0, 0.1);
    transform: translateY(-2px);
}

.creator-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(183, 255, 0, 0.2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid var(--accent);
}

.creator-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    transition: border-color 0.2s ease;
}

.creator-card:hover .creator-avatar {
    border-color: var(--accent);
}

.creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.creator-info {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.creator-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    word-break: break-word;
}

.creator-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.games-badge,
.plays-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.plays-badge {
    background: rgba(183, 255, 0, 0.1);
    color: var(--accent);
    border-color: rgba(183, 255, 0, 0.3);
    font-weight: 600;
}

/* Search Results */
.search-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.creator-games {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.game-pill {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Platform Stats Section */
.platform-stats-section {
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(183, 255, 0, 0.1);
}

.stat-card.loading {
    opacity: 0.6;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Built by section */
.built-by-section {
    text-align: center;
    margin: 0 0 2rem;
    opacity: 0.8;
}

.built-by-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.created4fun-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.created4fun-link:hover {
    color: #a0d400;
    text-decoration: underline;
}

.social-link {
    color: #fff;
    margin-left: 0.5rem;
    font-size: 0.9rem;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.social-link:hover {
    opacity: 1;
}

.farcaster-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: top;
    background: url('../images/farcaster-icon.svg') no-repeat center center;
    background-size: contain;
    transition: opacity 0.2s ease;
    margin-left: 0;
}

/* Modal enhancements */
.modal-share {
    position: absolute;
    top: 12px;
    right: 50px;
    /* Position between rank and close button */
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-share:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.creator-rank-badge {
    background: rgba(183, 255, 0, 0.2);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    margin-left: 8px;
}

/* Section Headers */
.top-developers-section {
    margin-top: 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .top-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .header .top-bar {
        flex-direction: row;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .modal-content {
        margin: 20px;
        max-width: none;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .creators-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .creator-card {
        padding: 1rem;
    }

    .creator-avatar {
        width: 60px;
        height: 60px;
    }

    .creator-name {
        font-size: 1rem;
    }

    .creator-stats {
        gap: 0.25rem;
    }

    .games-badge,
    .plays-badge {
        font-size: 11px;
        padding: 3px 6px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .built-by-section p {
        font-size: 0.8rem;
    }

    .creator-rank-badge {
        font-size: 0.7rem;
        padding: 1px 4px;
    }

    .modal-share {
        right: 45px;
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .farcaster-icon {
        width: 12px;
        height: 12px;
    }
}