/**
 * Data Lake Feed Modal Styles
 *
 * @package DataLakeIntegration
 * @since 2.2.1
 */

/* Modal Container */
.datalake-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    overflow-y: auto;
}

/* Modal Overlay */
.datalake-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

/* Modal Container */
.datalake-modal-container {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    z-index: 1000000;
}

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

.datalake-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Modal Content */
.datalake-modal-content {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 30px;
}

/* Loading State */
.datalake-modal-loading {
    text-align: center;
    padding: 80px 20px;
}

.datalake-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.datalake-modal-loading p {
    color: #666;
    font-size: 16px;
}

/* Error State */
.datalake-modal-error {
    text-align: center;
    padding: 60px 20px;
}

.datalake-modal-error p {
    color: #d32f2f;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Modal Body - Single Article Styles */
.datalake-modal-body {
    line-height: 1.6;
}

.datalake-modal-body .datalake-feed-single {
    max-width: 100%;
    padding: 0;
}

.datalake-modal-body .feed-single-nav {
    display: none; /* Hide back button in modal */
}

.datalake-modal-body .feed-single-title {
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.datalake-modal-body .feed-single-meta {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.datalake-modal-body .feed-single-image-wrapper {
    margin: 0 -30px 30px;
}

.datalake-modal-body .feed-single-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 0;
}

.datalake-modal-body .feed-article-body {
    font-size: 17px;
    line-height: 1.7;
}

.datalake-modal-body .feed-article-body p {
    margin-bottom: 18px;
}

.datalake-modal-body .feed-article-body h2 {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 12px;
}

.datalake-modal-body .feed-article-body h3 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.datalake-modal-body .feed-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Feed Tags in Modal */
.datalake-modal-body .feed-tags {
    margin: 15px 0;
}

.datalake-modal-body .feed-tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 5px 5px 0;
    background: #f3f4f6;
    color: #666;
    border-radius: 4px;
    font-size: 13px;
}

.datalake-modal-body .feed-tag.tag-urgency {
    background: #fee;
    color: #c00;
}

.datalake-modal-body .feed-tag.tag-language {
    background: #efe;
    color: #060;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .datalake-modal-container {
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .datalake-modal-content {
        padding: 20px;
        max-height: calc(100vh - 40px);
    }

    .datalake-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .datalake-modal-body .feed-single-title {
        font-size: 24px;
    }

    .datalake-modal-body .feed-single-image-wrapper {
        margin: 0 -20px 20px;
    }

    .datalake-modal-body .feed-article-body {
        font-size: 16px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .datalake-modal-container {
        margin: 30px;
        max-width: calc(100% - 60px);
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .datalake-modal-overlay {
        background: rgba(0, 0, 0, 0.9);
    }

    .datalake-modal-close {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .datalake-modal-overlay,
    .datalake-modal-container {
        animation: none;
    }

    .datalake-spinner {
        animation-duration: 2s;
    }
}
