:root {
    /* GitHub Dark Theme Palette */
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-input: #0d1117;
    --border-color: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --primary: #238636;
    /* GitHub Green */
    --primary-hover: #2ea043;
    --accent: #58a6ff;
    /* GitHub Blue */
    --highlight: #f0f6fc;
    --glass-border: rgba(240, 246, 252, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(56, 139, 253, 0.05), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 3rem;
    color: var(--text-main);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.highlight {
    color: var(--accent);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glass Card */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.search-card {
    margin: 0 auto 3rem;
    padding: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1px;
    /* For border effect if needed, or just gap */
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(177, 186, 196, 0.12);
}

.tab-btn.active {
    color: var(--text-main);
    font-weight: 600;
    background: rgba(177, 186, 196, 0.12);
}

/* Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* Inputs */
.input-group {
    position: relative;
}

textarea {
    width: 100%;
    height: 100px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    resize: none;
    transition: border-color 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

.input-hint {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-item label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
}

.checkbox-container input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkbox-container input:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* Button */
.search-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

/* Results List */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.badge {
    background: rgba(110, 118, 129, 0.4);
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Border separation */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card);
}

.repo-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

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

.repo-item:hover {
    background-color: rgba(177, 186, 196, 0.04);
}

.repo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.repo-content {
    flex-grow: 1;
    min-width: 0;
    /* For text truncation */
}

.repo-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.repo-name {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
}

.repo-name:hover {
    text-decoration: underline;
}

.repo-meta-inline {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.repo-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.repo-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-item.stars {
    color: var(--text-main);
}

.topic-tag {
    background: rgba(56, 139, 253, 0.1);
    color: #58a6ff;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    line-height: 1.5;
    display: inline-block;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem;
    font-size: 1.1rem;
}


@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-muted);
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}