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

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

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: #fafbfc;
    color: #24292e;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

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

.header-container {
    width: 100%;
    padding: 0;
    margin: 0;
    max-width: none;
}

/* Header Styles */
.header {
    background: #0969da;
    border-bottom: none;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    width: 100%;
    box-sizing: border-box;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 24px;
    color: #0969da;
    background: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-section h1 {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 20px;
    font-weight: 600;
    color: #0969da;
    background: white;
    width: 36px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
}

.stat-label {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.refresh-btn {
    background: white;
    color: #0969da;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #f6f8fa;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.refresh-btn i {
    font-size: 14px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #0969da;
    font-size: 16px;
}

.section-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2328;
}

.resource-count {
    color: #586069;
    font-size: 16px;
    font-weight: 400;
}

.view-controls {
    display: flex;
    gap: 8px;
}

.view-toggle {
    background: transparent;
    border: 1px solid #d0d7de;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #656d76;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.view-toggle.active {
    background: #0969da;
    color: white;
    border-color: #0969da;
}

.view-toggle:hover:not(.active) {
    color: #24292e;
}

/* Filters Section */
.filters-section {
    background: transparent;
    padding: 0;
    border: none;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #656d76;
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.category-filter {
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    min-width: 180px;
}

.category-filter:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}


/* Loading, Error, and Empty States */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.loading-spinner i {
    font-size: 32px;
    color: #0969da;
    margin-bottom: 20px;
}

.error-icon i,
.empty-icon i {
    font-size: 48px;
    color: #656d76;
    margin-bottom: 20px;
}

.error-state h3,
.empty-state h3 {
    font-size: 20px;
    color: #1f2328;
    margin-bottom: 10px;
}

.error-state p,
.empty-state p {
    color: #656d76;
    font-size: 16px;
    margin-bottom: 20px;
}

.retry-btn {
    background: #0366d6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #0256cc;
}

/* Resources Container */
.resources-container {
    transition: all 0.3s ease;
}

.resources-container.grid-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .resources-container.grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .resources-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

.resources-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Resource Card Styles */
.resource-card {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.resource-card:hover {
    border-color: #0969da;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.list-view .resource-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
}

.list-view .resource-card:hover {
    transform: none;
}

.card-header {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.card-category {
    background: #f6f8fa;
    color: #656d76;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: inline-block;
}

.resource-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-icon i {
    font-size: 16px;
    color: #656d76;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.list-view .card-header {
    margin-bottom: 0;
    flex: 1;
}

.list-view .resource-icon {
    width: 40px;
    height: 40px;
}

.list-view .resource-icon i {
    font-size: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2328;
    margin-bottom: 4px;
    line-height: 1.25;
    word-wrap: break-word;
}

.list-view .card-title {
    font-size: 16px;
    margin-bottom: 4px;
}

.card-description {
    color: #656d76;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.list-view .card-description {
    margin-bottom: 8px;
}

.card-meta {
    display: none;
}

.list-view .card-meta {
    margin-bottom: 0;
}


.tags-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    background: #f1f3f4;
    color: #5f6368;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-actions {
    margin-top: 15px;
}

.list-view .card-actions {
    margin-top: 0;
}

.view-btn {
    background: #8b5cf6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.list-view .view-btn {
    padding: 6px 12px;
    font-size: 13px;
}

/* Responsive Design */
/* Footer Styles */
.footer {
    background: #f6f8fa;
    border-top: 1px solid #d0d7de;
    padding: 24px 0;
    margin-top: 48px;
}

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

.footer-left p,
.footer-right p {
    color: #656d76;
    font-size: 14px;
    margin: 0;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pagination-btn {
    background: #0969da;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #0550ae;
}

.pagination-btn:disabled {
    background: #f6f8fa;
    color: #656d76;
    cursor: not-allowed;
    border: 1px solid #d0d7de;
}

.pagination-info {
    color: #1f2328;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 16px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .logo {
        justify-content: center;
    }
    
    .title-section h1 {
        font-size: 18px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .view-controls {
        align-self: stretch;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-container {
        min-width: auto;
        max-width: none;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .category-filter {
        min-width: auto;
        width: 100%;
    }
    
    .resources-container.grid-view {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .resource-card {
        padding: 16px;
    }
    
    .list-view .resource-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    
    .stats {
        gap: 24px;
    }
    
    .stat-number {
        font-size: 18px;
        width: 32px;
        height: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 12px;
    }
    
    .title-section h1 {
        font-size: 16px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .section-title h2 {
        font-size: 14px;
    }
    
    .filters-section {
        gap: 8px;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .category-filter {
        width: 100%;
        min-width: auto;
    }
    
    .card-header {
        gap: 8px;
    }
    
    .resource-icon {
        width: 28px;
        height: 28px;
    }
    
    .resource-icon i {
        font-size: 14px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .card-description {
        font-size: 12px;
    }
    
    .view-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .stats {
        gap: 16px;
    }
    
    .refresh-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.loading-state p {
    color: #656d76;
    font-size: 16px;
}

/* Refresh button spinning animation */
.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

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