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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 2rem;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Category Sections */
.category-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.category-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.category-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.category-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.category-content {
    padding: 1.5rem;
}

/* Page Items */
.page-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.page-item:hover {
    background: #f0f8ff;
    border-color: #4facfe;
    transform: translateX(5px);
}

.page-item:last-child {
    margin-bottom: 0;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.3rem;
}

.page-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.page-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-tags {
    display: flex;
    gap: 0.3rem;
}

.page-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.icp-info {
    font-size: 0.9rem;
}

.icp-info a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-info a:hover {
    color: white;
}

.icp-divider {
    margin: 0 0.5rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 2rem 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-header,
    .category-content {
        padding: 1rem;
    }
    
    .page-item {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .page-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}