:root {
    /* Light theme */
    --primary-color: #238636;
    --secondary-color: #2ea043;
    --background-color: #ffffff;
    --surface-color: #f6f8fa;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --border-color: #d0d7de;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --hover-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-theme="dark"] {
    --primary-color: #2ea043;
    --secondary-color: #238636;
    --background-color: #0d1117;
    --surface-color: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.4);
    --hover-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 1000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* Header */
.dashboard-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
}

.beta-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.theme-toggle,
.refresh-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.theme-toggle:hover,
.refresh-btn:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
    background: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 180px);
    padding: 2rem;
    gap: 2rem;
}

/* Filter Panel */
.filter-panel {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 140px;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-subtitle {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Category Filter */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.category-btn {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Filter Selects */
.filter-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Language Filter */
.language-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.language-tag {
    padding: 0.4rem 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-tag:hover,
.language-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Reset Button */
.reset-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Dashboard Main */
.dashboard-main {
    min-height: 100vh;
}

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

.repo-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.repo-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.repo-title a {
    color: inherit;
    text-decoration: none;
}

.repo-title a:hover {
    color: var(--primary-color);
}

.repo-category {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.repo-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.repo-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.repo-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.repo-stat i {
    color: var(--primary-color);
}

.repo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.repo-language {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.language-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.repo-updated {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.repo-actions {
    display: flex;
    gap: 0.25rem;
}

.repo-share-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.repo-share-btn:hover {
    background: var(--surface-color);
    color: var(--primary-color);
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

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

/* Error State */
.error-container {
    text-align: center;
    padding: 4rem;
}

.error-icon {
    font-size: 3rem;
    color: #f85149;
    margin-bottom: 1rem;
}

.error-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.retry-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.load-more-btn:hover {
    background: var(--secondary-color);
}

/* Footer */
.dashboard-footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version {
    background: var(--background-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.share-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.linkedin:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.share-btn.twitter:hover {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.share-btn.copy-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Share Modal Styles */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.share-modal-content {
    position: relative;
    background: var(--surface-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.share-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

.share-modal-body {
    padding: 1.5rem;
}

.share-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100px;
    text-align: center;
}

.share-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-option.twitter:hover {
    border-color: #1da1f2;
    background: rgba(29, 161, 242, 0.05);
}

.share-option.linkedin:hover {
    border-color: #0077b5;
    background: rgba(0, 119, 181, 0.05);
}

.share-option.copy:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb, 35, 134, 54), 0.05);
}

.share-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.share-option.twitter .share-icon {
    background: #1da1f2;
    color: white;
}

.share-option.linkedin .share-icon {
    background: #0077b5;
    color: white;
}

.share-option.copy .share-icon {
    background: var(--primary-color);
    color: white;
}

.share-option span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.share-preview {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.share-text-preview {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.share-url-preview {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
    opacity: 0.8;
}

.share-custom {
    margin-bottom: 1rem;
}

.share-custom-text {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.share-custom-text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 35, 134, 54), 0.1);
}

.share-custom-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.share-custom-btn:hover {
    background: var(--secondary-color);
}

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

.share-note {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .share-options {
        gap: 0.5rem;
    }

    .share-option {
        width: 80px;
        padding: 0.75rem 0.5rem;
    }

    .share-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Monetization Section */
.monetization-section {
    margin-top: 1rem;
    padding-top: 1rem;
    text-align: center;
}

.support-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.support-options {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.support-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.support-btn.sponsor {
    background: #db61a2;
    color: white;
    border: 1px solid #db61a2;
}

.support-btn.coffee {
    background: #ff813f;
    color: white;
    border: 1px solid #ff813f;
}

.support-btn.patreon {
    background: #ff424d;
    color: white;
    border: 1px solid #ff424d;
}

.support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Newsletter Bar */
.newsletter-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.newsletter-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.newsletter-content p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
    max-width: 400px;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.9);
}

.newsletter-form button {
    padding: 0.5rem 1.5rem;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.newsletter-form button:hover {
    background: #f0f0f0;
}

.newsletter-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 350px;
}

.toast {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr; /* 1 column on very small screens */
    }
}

