/* Topics Header */
.topics-header {
    padding: 8rem 2rem 4rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.topics-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.topics-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #4a4a4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.topics-header p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search and Filters */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

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

.search-box input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all var(--transition-speed) ease;
    background: rgba(255, 255, 255, 0.9);
}

.search-box i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    font-size: 1.2rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

.filter-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.filter-options select {
    padding: 1rem 1.5rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    flex: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1.5rem) center;
    padding-right: 3rem;
}

.filter-options select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: white;
}

/* Active Filters */
.active-filters {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
}

.filter-tags {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-tag {
    background: white;
    color: var(--accent-color);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all var(--transition-speed) ease;
}

.filter-tag:hover {
    background: rgba(99, 102, 241, 0.05);
}

.filter-tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition-speed) ease;
}

.filter-tag button:hover {
    opacity: 1;
}

.clear-filters {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: all var(--transition-speed) ease;
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.clear-filters:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.05);
}

/* Posts Grid */
.topics-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    transition: opacity var(--transition-speed) ease;
}

/* Post Card Styling */
.post-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

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

.post-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.gradient-bg {
    height: 100%;
    filter: blur(20px) brightness(1.1);
    transform: scale(1.1);
    transition: all var(--transition-speed) ease;
}

.post-card:hover .gradient-bg {
    filter: blur(15px) brightness(1.2);
    transform: scale(1.15);
}

.post-card-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--primary-color);
}

.post-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta i {
    color: var(--accent-color);
    opacity: 0.9;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap var(--transition-speed) ease;
}

.read-more:hover {
    gap: 0.8rem;
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 4rem 0;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-spinner p {
    color: var(--accent-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 6rem 0;
    display: none;
}

.no-results i {
    font-size: 3.5rem;
    color: var(--accent-color);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.no-results h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.no-results p {
    opacity: 0.7;
    font-size: 1.1rem;
}

/* Start Here Banner */
.start-here-banner {
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 0.5rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
    display: none;
}

/* Must Read Banner */
.must-read-banner {
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: linear-gradient(135deg, #FF6B6B, #FF4444);
    color: white;
    padding: 0.5rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
    display: none;
}

/* Tutorial Banner */
.tutorial-banner {
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    padding: 0.5rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
    display: none;
}

.post-card[data-start-here="true"] .start-here-banner,
.post-card[data-must-read="true"] .must-read-banner,
.post-card[data-tutorial="true"] .tutorial-banner {
    display: block;
}

@media (max-width: 768px) {
    .topics-header {
        padding: 6rem 1rem 3rem;
    }

    .search-container {
        margin: 0 1rem;
        padding: 1.5rem;
    }

    .filter-options {
        flex-direction: column;
    }

    .filter-options select {
        width: 100%;
    }

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

    .active-filters {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .clear-filters {
        align-self: flex-end;
    }

    .start-here-banner {
        right: -1.5rem;
        padding: 0.4rem 1.5rem;
        font-size: 0.8rem;
    }

    .must-read-banner {
        right: -1.5rem;
        padding: 0.4rem 1.5rem;
        font-size: 0.8rem;
    }
}

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