/* Enhanced topic cards for subcategory pages */

.topic-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin: 0 auto;
}

.topic {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent;
}

.topic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.topic:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.topic:hover::before {
    opacity: 1;
}

.topic:nth-child(3n+1) {
    border-left-color: #8b5cf6; /* Purple */
}

.topic:nth-child(3n+2) {
    border-left-color: #059669; /* Green */
}

.topic:nth-child(3n+3) {
    border-left-color: #dc2626; /* Red */
}

.topic h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic > p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.topic .section {
    padding: 1.5rem;
    margin: 1.5rem 0 0;
    background: var(--bg-alt);
    border-radius: 12px;
}

.topic .section h5 {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
}

.topic .writing-tips,
.topic .poem-box,
.topic .dialogue-box {
    animation: fadeIn 0.6s ease-out;
}

.topic .poem-box p,
.topic .dialogue-box p {
    line-height: 1.8;
}

.topic .poem-box h5 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.topic .writing-tips ul,
.topic .writing-tips ol {
    list-style-position: inside;
    padding-left: 0.5rem;
}

.topic .writing-tips li {
    padding: 0.4rem 0;
    line-height: 1.6;
}

.topic .writing-tips li ul,
.topic .writing-tips li ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.topic .writing-tips strong {
    color: var(--text);
    font-weight: 600;
}

.topic .quiz-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
}

.topic .quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.topic .formula {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
    color: #16a34a;
}

.topic .example-box {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d;
}

.topic .grammar-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #93c5fd;
}

.topic .poem-box {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border: 1px solid #e9d5ff;
    border-left: 3px solid #8b5cf6;
}

.topic .dialogue-box {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: #ddd6fe;
}

.topic .writing-tips {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-color: #bae6fd;
}

.topic .idiom-box {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
}

.topic .quiz-box {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .topic-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .topic {
        padding: 1.5rem;
    }

    .topic h4 {
        font-size: 1.25rem;
    }

    .topic > p {
        font-size: 1rem;
    }
}

/* Entry animations */
.topic {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease-out forwards;
}

.topic:nth-child(1) { animation-delay: 0.1s; }
.topic:nth-child(2) { animation-delay: 0.2s; }
.topic:nth-child(3) { animation-delay: 0.3s; }
.topic:nth-child(4) { animation-delay: 0.4s; }
.topic:nth-child(5) { animation-delay: 0.5s; }

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