/* ==================== RESEARCH & PUBLICATIONS SECTION ==================== */

.research {
    padding: var(--section-padding);
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

/* Research Card */
.research-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--field-color, var(--primary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.research-card:hover::before {
    transform: scaleX(1);
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--field-color, var(--primary-color));
}

/* Field Badge */
.research-field-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--field-color, var(--primary-color));
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Research Title */
.research-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.research-card:hover .research-title {
    color: var(--field-color, var(--primary-color));
}

/* Field Label */
.research-field-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
}

/* Description */
.research-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Topics Tags */
.research-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.research-topic-tag {
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--primary-light);
    transition: all 0.3s ease;
    animation: tagSlideIn 0.5s ease backwards;
}

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

@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.research-card:hover .research-topic-tag {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

/* Card Footer */
.research-card-footer {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Research Buttons */
.research-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    flex: 1;
    justify-content: center;
}

.research-btn i {
    font-size: 0.9rem;
}

.research-btn-primary {
    background: var(--field-color, var(--primary-color));
    color: white;
}

.research-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.research-btn-details {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.research-btn-details:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== RESEARCH MODAL ==================== */

.research-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.research-modal-content {
    background: var(--bg-card);
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.research-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.research-modal-close:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
    transform: rotate(90deg);
}

.research-modal-header {
    padding: 40px 40px 30px;
    border-bottom: 1px solid var(--border-color);
}

.research-modal-header .research-field-badge {
    margin-bottom: 15px;
}

.research-modal-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.research-modal-field {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

.research-modal-body {
    padding: 30px 40px;
}

.research-modal-section {
    margin-bottom: 30px;
}

.research-modal-section:last-child {
    margin-bottom: 0;
}

.research-modal-section h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.research-modal-section h3 i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.research-modal-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.research-modal-topics,
.research-modal-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.research-skill-badge {
    padding: 8px 16px;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 500;
}

.research-modal-footer {
    padding: 20px 40px 40px;
    display: flex;
    justify-content: center;
}

.research-modal-footer .research-btn {
    min-width: 200px;
}

/* Field-specific colors */
.research-card[data-field="computational-physics"] {
    --field-color: #14b8a6;
}

.research-card[data-field="ai-ethics"] {
    --field-color: #ec4899;
}

.research-card[data-field="statistical-analysis"] {
    --field-color: #6366f1;
}

.research-card[data-field="biology"] {
    --field-color: #22c55e;
}

.research-card[data-field="economics"] {
    --field-color: #f59e0b;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .research-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .research-card {
        padding: 25px;
    }
    
    .research-title {
        font-size: 1.3rem;
    }
    
    .research-card-footer {
        flex-direction: column;
    }
    
    .research-btn {
        width: 100%;
    }
    
    .research-modal-content {
        margin: 20px;
        max-height: 85vh;
    }
    
    .research-modal-header,
    .research-modal-body {
        padding: 25px;
    }
    
    .research-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .research-modal-footer {
        padding: 15px 25px 25px;
    }
}

@media (max-width: 480px) {
    .research-card {
        padding: 20px;
    }
    
    .research-title {
        font-size: 1.2rem;
    }
    
    .research-modal-header h2 {
        font-size: 1.3rem;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .research-card,
    .research-btn,
    .research-topic-tag {
        transition: none;
        animation: none;
    }
    
    .research-card:hover {
        transform: none;
    }
}
