/**
 * Research Cards - CSS Styling
 * Inspired by Vue.js Vuetify card design
 */

/* Container */
.research-cards-container {
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Grid Layout */
.research-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .research-cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Individual Card */
.research-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.research-card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px;
    /* background: #000000; */
}

/* Card Image */
.research-card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    /* background: #1a1a1a; */
    flex-shrink: 0;
}

.research-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(0%) brightness(1);
}

.research-card:hover .research-card-image img {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(1.1);
}

/* Card Content */
.research-card-content {
    padding: 20px;
    background: var(--pix-main-color);
    /* backdrop-filter: blur(10px) brightness(0.5);
    -webkit-backdrop-filter: blur(10px) brightness(0.5); */
    transition: all 0.3s ease;
    height: 100%;
}

.research-card:hover .research-card-content {
    background: var(--pix-main-color-lighter-2x);
    /* backdrop-filter: blur(8px) brightness(0.6);
    -webkit-backdrop-filter: blur(8px) brightness(0.6); */
}

.research-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    text-align: center;
}

/* Modal Overlay */
.research-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.research-modal.active {
    display: flex;
}

.research-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Modal Content */
.research-modal-content {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    width: fit-content;
    max-width: min(90vw, 1200px);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--pix-black-color-lighter);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.research-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s ease;
}

.research-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Image */
.research-modal-image {
    grid-row: 1;
    max-height: 450px;
    overflow: hidden;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.research-modal-image img {
    width: 100%;
    max-width: min(90vw, 1200px);
    height: auto;
    max-height: 450px;
    object-fit: contain;
    display: block;
}

/* Modal Body */
.research-modal-body {
    grid-row: 2;
    padding: 30px;
    color: #e0e0e0;
    min-width: 0;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.research-modal-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.research-modal-authors {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #b0b0b0;
    font-style: italic;
    line-height: 1.5;
}

.research-modal-journal {
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.6;
}

.research-modal-journal a {
    color: #4caf50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.research-modal-journal a:hover {
    color: #66bb6a;
    text-decoration: underline;
}

.research-modal-description {
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #c0c0c0;
}

/* Action Buttons */
.research-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.research-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.research-btn-arxiv {
    background: #4caf50;
    color: #ffffff;
}

.research-btn-arxiv:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    color: #ffffff;
}

.research-btn-youtube {
    background: #ff0000;
    color: #ffffff;
}

.research-btn-youtube:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
    color: #ffffff;
}

.research-btn svg {
    width: 18px;
    height: 18px;
}

/* Scrollbar Styling for Modal */
.research-modal-content::-webkit-scrollbar {
    width: 8px;
}

.research-modal-content::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.research-modal-content::-webkit-scrollbar-thumb {
    background: #4caf50;
    border-radius: 4px;
}

.research-modal-content::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Prevent body scroll when modal is open */
body.research-modal-open {
    overflow: hidden;
}

/* Loading State */
.research-cards-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 18px;
}

/* Empty State */
.research-cards-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.research-cards-empty h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #666;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .research-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .research-modal-body {
        padding: 20px;
    }

    .research-modal-title {
        font-size: 20px;
    }

    .research-modal-actions {
        flex-direction: column;
    }

    .research-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark Mode Compatibility */
@media (prefers-color-scheme: dark) {
    .research-card-inner {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .research-modal-content {
        background: #121212;
    }
}
