/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Search and Filter Section */
.search-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 15px auto;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #4ecdc4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.search-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.clear-search-btn:hover {
    background: #f8f9fa;
    color: #e74c3c;
}

.clear-search-btn.visible {
    display: block;
}

.search-stats {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Button rows */
.button-rows {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ffffff, #f5f7fa); /* white gradient */
    color: #000000;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    margin: 0 10px;
    text-overflow:clip;
    white-space: nowrap;
    overflow: hidden;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Category sections */
.category-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Learning grid */
.learning-grid {
    padding: 10px;
    width: 100%;
    overflow-x: scroll;
    white-space: nowrap;
}

/* Learning card styles */
.learning-card {
    display: inline-block;
    text-decoration: none;
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
    width: 300px;
    margin: 15px;
    min-height: 250px;
}

/* Rainbow gradient backgrounds for each card - using different patterns for variety */
.learning-card:nth-child(4n+1) {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.learning-card:nth-child(4n+2) {
    background: linear-gradient(135deg, #45b7d1, #96c93d);
}

.learning-card:nth-child(4n+3) {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.learning-card:nth-child(4n+4) {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
}

/* Alternative gradient patterns for variety */
.learning-card:nth-child(8n+5) {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.learning-card:nth-child(8n+6) {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.learning-card:nth-child(8n+7) {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.learning-card:nth-child(8n+8) {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

/* Card content */
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    text-align: center;
    text-overflow: ellipsis;
    white-space: wrap;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

.card-caption {
    display: -webkit-box;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: wrap;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

/* Hover effects */
.learning-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.learning-card:hover .card-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Mouse down effects */
.learning-card:active {
    transform: translateY(-3px) scale(0.98);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: all 0.1s ease;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }
    
    .learning-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .search-input {
        padding: 12px 45px 12px 15px;
        font-size: 0.95rem;
    }
    
    .clear-search-btn {
        right: 12px;
        font-size: 1.1rem;
    }
    
    .category-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .category-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .learning-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .learning-card {
        padding: 20px 15px;
        min-height: 160px;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-caption {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 15px;
    }
    
    .search-input {
        padding: 10px 40px 10px 12px;
        font-size: 0.9rem;
    }
    
    .clear-search-btn {
        right: 10px;
        font-size: 1rem;
    }
    
    .learning-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .learning-card {
        padding: 18px 12px;
        min-height: 140px;
    }
    
    .category-section {
        padding: 15px;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.learning-card:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Category section hover effect */
.category-section:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}
