/**
 * Topics Section Styles
 */

/* ======= Topics Section ======= */
.topics-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #f0f8f0, #e8f5e9);
    position: relative;
    overflow: hidden;
}

.topics-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, var(--primary-color) 1px, transparent 1px),
        radial-gradient(circle, var(--primary-color) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    opacity: 0.05;
    pointer-events: none;
}

.section-subtitle {
    display: block;
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

.section-description {
    max-width: 600px;
    margin: 15px auto 0;
    color: var(--text-color);
    font-size: 1.1rem;
    opacity: 0.8;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
    margin-top: 30px;
}

.topic-card {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 20px 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.5s ease;
}

.topic-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.topic-card:hover::before {
    height: 100%;
}

.topic-icon {
    position: relative;
    margin-bottom: 25px;
    display: inline-block;
}

.topic-icon i {
    font-size: 3rem;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, color 0.3s ease;
}

.topic-icon::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(76, 175, 80, 0.1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.topic-card:hover .topic-icon::after {
    width: 85px;
    height: 85px;
    background-color: rgba(76, 175, 80, 0.2);
}

.topic-card:hover .topic-icon i {
    transform: translateY(-5px);
}

.topic-title {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
    min-height: 3.5em !important; /* Adjust as needed for your design */
    display: flex;
    align-items: center;
    justify-content: center; /* Optional: center text vertically */
    text-align: center;      /* Optional: center text horizontally */
}

.topic-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.topic-card:hover .topic-title::after {
    width: 70%;
    left: 15%;
}

.topic-description {
    position: relative;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 0;
    max-width: 100%;
    cursor: pointer;
}

.description-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    transition: all 0.4s ease;
    z-index: 1;
}

.description-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    border-radius: 12px;
}

.description-text p {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
    margin: 0;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.topic-description:hover .description-text {
    opacity: 1;
}

.topic-description:hover .description-text p {
    transform: translateY(0);
}

.topic-description:hover .description-image {
    transform: scale(1.1);
}

/* Touch device support */
.topic-description:active .description-text,
.topic-description.touch-active .description-text {
    opacity: 1;
}

.topic-description:active .description-text p,
.topic-description.touch-active .description-text p {
    transform: translateY(0);
}

.topic-description:active .description-image,
.topic-description.touch-active .description-image {
    transform: scale(1.1);
}

/* Specific background images for each card */
.topic-description[data-image="theme-focus1"] .description-image {
    background-image: url('/wp-content/themes/agrifutureconferex/assets/images/theme-focus/theme-focus1.png');
}

.topic-description[data-image="theme-focus2"] .description-image {
    background-image: url('/wp-content/themes/agrifutureconferex/assets/images/theme-focus/theme-focus2.png');
}

.topic-description[data-image="theme-focus3"] .description-image {
    background-image: url('/wp-content/themes/agrifutureconferex/assets/images/theme-focus/theme-focus3.png');
}

/* Responsive styles */
@media (max-width: 991px) {
    .topics-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .section-description {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .topics-section {
        padding: 60px 0;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .section-description {
        font-size: 0.95rem;
        margin-top: 10px;
    }
    
    .topics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }
    
    .topic-card {
        padding: 30px 20px;
    }
    
    .topic-icon i {
        font-size: 2.5rem;
    }
    
    .topic-icon::after {
        width: 60px;
        height: 60px;
    }
    
    .topic-card:hover .topic-icon::after {
        width: 70px;
        height: 70px;
    }
    
    .topic-title {
        font-size: 1.3rem;
    }
    
    .topic-description {
        height: 160px;
        margin: 15px auto 0;
    }
    
    .description-text {
        padding: 15px;
    }
    
    .description-text p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .section-subtitle {
        font-size: 0.8rem;
    }
    
    .section-description {
        font-size: 0.9rem;
    }
    
    .topic-icon i {
        font-size: 2.2rem;
    }
    
    .topic-title {
        font-size: 1.2rem;
    }
    
    .topic-description {
        height: 140px;
        margin: 10px auto 0;
    }
    
    .description-text {
        padding: 12px;
    }
    
    .description-text p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
} 