/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --bg-main: #F9FAFB;
    --bg-surface: #FFFFFF;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-hover: #D1D5DB;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 100vh;
}

/* Sidebars */
.sidebar-left,
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sponsor-card {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sponsor-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.sponsor-icon {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
    display: block;
}

.sponsor-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.sponsor-card p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.advertise-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 0.75rem;
    text-align: center;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.advertise-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.advertise-icon {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.advertise-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

.advertise-spots {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Main Content */
.main-content {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-icon {
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-surface);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.share-site-btn {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.share-site-btn:hover {
    background-color: var(--bg-main);
    border-color: var(--border-hover);
}

.add-btn {
    background-color: var(--text-main);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.add-btn:hover {
    background-color: #000000;
}

/* Leaderboard Section */
.leaderboard-section {
    margin-bottom: 3rem;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.leaderboard-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.leaderboard-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-dropdown {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

/* Table */
.table-container {
    background: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background-color: var(--bg-main);
}

.leaderboard-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-table th.text-right {
    text-align: right;
}

.leaderboard-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}

.leaderboard-table tbody tr:hover {
    background-color: var(--bg-main);
}

.rank-cell {
    font-weight: 600;
    color: var(--text-secondary);
}

.startup-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.startup-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.startup-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.startup-logo.has-image {
    padding: 0;
    background: white;
    border: 1px solid var(--border);
}

.startup-info {
    display: flex;
    flex-direction: column;
}

.startup-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.1rem;
}

.startup-url {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.founder-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.founder-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: var(--bg-main);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

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

.founder-avatar.has-image {
    background: white;
    border: 1px solid var(--border);
}

.founder-handle {
    color: var(--text-secondary);
}

.founder-handle a {
    color: var(--text-secondary);
    text-decoration: none;
}

.founder-handle a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.revenue-cell,
.mrr-cell {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.share-cell {
    text-align: center;
    width: 60px;
}

.share-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.share-btn:hover {
    opacity: 1;
    background: var(--bg-main);
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.5rem;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--text-main);
    background: var(--bg-main);
}

.modal-content h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Form */
.form-step {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.submit-btn {
    width: 100%;
    background-color: var(--text-main);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

.submit-btn:hover:not(:disabled) {
    background-color: #000000;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.info-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #FEF3C7;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #78350f;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

footer p {
    margin-bottom: 0.5rem;
}

.footer-small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

footer a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    body {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .main-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    header {
        margin-bottom: 2rem;
    }

    .header-logo {
        font-size: 1.1rem;
    }

    .logo-icon {
        font-size: 1.3rem;
    }

    .hero {
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .search-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box input {
        font-size: 0.9rem;
        padding: 0.65rem 1rem 0.65rem 2.5rem;
    }

    .action-buttons {
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
    }

    .add-btn,
    .share-site-btn {
        flex: 1;
        justify-content: center;
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    .leaderboard-section {
        margin-bottom: 2rem;
    }

    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .leaderboard-header h2 {
        font-size: 1.25rem;
    }

    .leaderboard-filters {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-dropdown {
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
        border-radius: 8px;
    }

    .leaderboard-table {
        font-size: 0.8rem;
        min-width: 600px;
    }

    .leaderboard-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    .leaderboard-table td {
        padding: 0.65rem 0.5rem;
    }

    .rank-cell {
        font-size: 0.85rem;
    }

    .startup-cell {
        gap: 0.5rem;
    }

    .startup-logo {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .startup-name {
        font-size: 0.85rem;
    }

    .startup-url {
        font-size: 0.7rem;
    }

    .founder-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .founder-handle {
        font-size: 0.7rem;
    }

    .revenue-cell,
    .mrr-cell {
        font-size: 0.85rem;
    }

    .share-btn {
        font-size: 1rem;
        padding: 0.35rem;
    }

    .empty-state {
        padding: 2rem 1rem;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 1.5rem 1rem;
        width: 95%;
        max-height: 85vh;
    }

    .modal-content h2 {
        font-size: 1.5rem;
        padding-right: 2rem;
    }

    .modal-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .form-step {
        margin-bottom: 1.25rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .form-input {
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    .form-hint {
        font-size: 0.75rem;
    }

    .submit-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .info-notice {
        font-size: 0.8rem;
        padding: 0.85rem;
    }

    footer {
        margin-top: 3rem;
        padding-top: 1.5rem;
        font-size: 0.85rem;
    }

    .footer-small {
        font-size: 0.75rem;
    }

    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.35rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .add-btn,
    .share-site-btn {
        width: 100%;
    }

    .leaderboard-table {
        font-size: 0.75rem;
        min-width: 550px;
    }

    .startup-name {
        font-size: 0.8rem;
    }

    .modal-content h2 {
        font-size: 1.35rem;
    }
}

/* Success Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--text-main);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Support Chip */
.support-chip {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 280px;
    transition: all 0.3s ease;
}

.support-chip:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.support-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.follow-btn {
    background: #1DA1F2;
    color: white;
    text-decoration: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    display: block;
}

.follow-btn:hover {
    background: #1A91DA;
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .support-chip {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        padding: 0.85rem 1rem;
    }

    .support-text {
        font-size: 0.8rem;
    }

    .follow-btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }
}
