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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #ffffff;
    --background-alt: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    scroll-behavior: smooth;
}

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

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%), 
                url('./assets/images/banner.png') center/cover no-repeat;
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search Section */
.search-section {
    margin: 3rem 0;
}

.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
}

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

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.results-count {
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-download {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

.btn-download {
    background: var(--success-color);
    color: white;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Course Cards */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.course-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.course-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.course-provider {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.course-title a {
    color: white;
    text-decoration: none;
}

.course-title a:hover {
    text-decoration: underline;
}

.course-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--background-alt);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tag.skill-level {
    background: #dbeafe;
    color: #1e40af;
}

.tag.difficulty {
    background: #fef3c7;
    color: #92400e;
}

.tag.hands-on {
    background: #d1fae5;
    color: #065f46;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0;
    gap: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

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

.pagination-btn.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

.pagination-btn.ellipsis {
    border: none;
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.pagination-btn.ellipsis:hover {
    transform: none;
    border: none;
    color: var(--text-secondary);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-size-selector select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.page-size-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Jump to page input */
.jump-to-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.jump-to-page input {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

.jump-to-page input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.jump-to-page button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.jump-to-page button:hover {
    background: var(--primary-dark);
}

/* Loading and No Results */
.loading {
    text-align: center;
    padding: 3rem;
}

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

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

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-results svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* About Section */
.about-section {
    background: var(--background-alt);
    padding: 4rem 0;
}

.about-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.about-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Contribute Section */
.contribute-section {
    padding: 4rem 0;
}

.contribute-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contribute-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contribute-content > p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contribute-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.github-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.issue-template {
    background: var(--background-alt);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    text-align: left;
}

.issue-template h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.issue-template pre {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.issue-template code {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-buttons {
        width: 100%;
        flex-direction: column;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

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

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.75rem;
    }

    .pagination-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .jump-to-page {
        margin-left: 0;
        justify-content: center;
    }
}