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

body {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f8fafc;
}

a {
    text-decoration: none !important;
}

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

/* Breadcrumb */
.breadcrumb {
    background: #edf2f7;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    font-size: 0.9rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '›';
    margin: 0 0.5rem;
    color: #a0aec0;
}

.breadcrumb-list a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-list a:hover {
    color: #764ba2;
}

.breadcrumb-list .current {
    color: #4a5568;
    font-weight: 500;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    margin-bottom: 3rem;
}

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

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
}

/* Courses Section */
.courses-section {
    background: white;
    padding: 3rem 0;
    margin-top: -2rem;
    border-radius: 2rem 2rem 0 0;
    position: relative;
    z-index: 1;
}

.courses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    max-width: 800px;
}

.search-wrapper {
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #a0aec0;
}

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

.filter-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: #f7fafc;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sort-controls {
    margin-top: 1rem;
}

.sort-select {
    padding: 0.7rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
}

/* View Controls */
.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn svg {
    width: 18px;
    height: 18px;
    color: #4a5568;
}

.view-btn:hover,
.view-btn.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.view-btn.active svg {
    color: #667eea;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.courses-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.courses-list .course-card {
    display: flex;
}

.courses-list .course-card .course-image {
    width: 300px;
    flex-shrink: 0;
}

.courses-list .course-card .course-content {
    flex: 1;
    padding: 2rem;
}

/* Course Card */
.course-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    transform: translateY(20px);
    position: relative;
}

.course-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.course-card.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02), rgba(118, 75, 162, 0.02));
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.course-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image svg {
    width: 60px;
    height: 60px;
    color: white;
    opacity: 0.8;
}

.course-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-badge {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.new-badge {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.course-level {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.course-level.beginner {
    background: #48bb78;
}

.course-level.intermediate {
    background: #ed8936;
}

.course-level.advanced {
    background: #e53e3e;
}

/* Course Content */
.course-content {
    padding: 1.5rem;
}

.course-category {
    color: #667eea;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.course-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.course-description {
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.course-instructor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructor-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructor-avatar svg {
    width: 16px;
    height: 16px;
    color: white;
}

.instructor-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
}

.course-stats {
    display: flex;
    gap: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #718096;
}

.stat svg {
    width: 14px;
    height: 14px;
}

/* Course Footer */
.course-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.enroll-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    width: 100%;
    max-width: 200px;
}

.enroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-number {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-number.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-dots {
    color: #a0aec0;
    padding: 0 0.5rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.cta-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.cta-btn.secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

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

    .hero-stats {
        gap: 2rem;
    }

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

    .courses-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls {
        max-width: none;
    }

    .search-wrapper {
        max-width: none;
    }

    .filter-buttons {
        justify-content: center;
    }

    .view-controls {
        justify-content: center;
    }

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

    .course-card.featured {
        grid-column: span 1;
    }

    .courses-list .course-card {
        flex-direction: column;
        max-height: none;
    }

    .courses-list .course-card .course-image {
        width: 100%;
    }

    .courses-list .course-card .course-content {
        padding: 1.5rem;
    }

    .course-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-footer {
        justify-content: center;
    }

    .enroll-btn {
        width: 100%;
        max-width: none;
        text-align: center;
    }

    .nav {
        gap: 1rem;
    }

    .nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

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

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .pagination-numbers {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .cta-features {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .courses-section {
        padding: 2rem 0;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .course-content {
        padding: 1.2rem;
    }

    .course-title {
        font-size: 1.1rem;
    }

    .course-description {
        font-size: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .course-image {
        height: 180px;
    }

    .placeholder-image svg {
        width: 50px;
        height: 50px;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

/* Enhanced Hover Effects */
.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 16px;
}

.course-card:hover::before {
    opacity: 1;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

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

/* Smooth Transitions */
* {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus States for Accessibility */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .header,
    .breadcrumb,
    .hero-section,
    .filter-controls,
    .view-controls,
    .pagination,
    .cta-section,
    .footer {
        display: none;
    }

    .course-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
        margin-bottom: 1rem;
    }

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

    .enroll-btn {
        display: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Course Card Variants for List View */
.courses-list .course-card .course-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.courses-list .course-card .course-title {
    font-size: 1.4rem;
}

.courses-list .course-card .course-meta {
    margin-bottom: 0.5rem;
}

.courses-list .course-card .course-rating {
    margin-bottom: 1rem;
}

/* Special Effects */
.course-card.featured::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    z-index: -1;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.course-card.featured:hover::after {
    opacity: 0.1;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .course-card {
        border: 2px solid #000;
    }

    .filter-btn.active {
        background: #000;
        color: #fff;
    }

    .enroll-btn {
        background: #000;
        color: #fff;
    }
}