/**
 * Case Studies Modal Styles
 *
 * @package RIKAI_Marketing
 */

/* Modal Container */
.case-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 200ms ease;
}

.case-modal.is-open {
    display: flex;
    opacity: 1;
}

/* Modal Overlay */
.case-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

/* Modal Content */
.case-modal-content {
    position: relative;
    max-width: 960px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 60px 0px 40px;
    z-index: 10000;
    transform: scale(0.9);
    transition: transform 200ms ease;
}

.case-modal.is-open .case-modal-content {
    transform: scale(1);
}

.case-modal-content--body {
    background-color: #ffffff;
}

/* Close Button */
.case-modal-close {
    position: absolute;
    top: -10px;
    right: 0px;
    width: 40px;
    height: 40px;
    background: unset;
    border: none;
    font-size: 60px;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    z-index: 10001;
    transition: scale 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-modal-close:hover {
    scale: 1.2;
}

.case-modal-close-bottom,
.case-modal-close-bottom.btn {
    margin-top: 20px;
    margin-left: calc(50% - 106px);
    color: var(--primary-color) !important;
    background-color: #ffffff !important;
    min-width: 195px;
}

.case-modal-close-bottom:hover,
.case-modal-close-bottom.btn:hover {
    background-color: var(--dark-color) !important;
    color: #ffffff !important;
    border-color: #ffffff;
}

/* Modal Body */
#case-modal-body {
    padding: 40px;
}

/* Modal Case Content */
.modal-case-content {
    max-width: 100%;
}

/* Modal Case Image */
.modal-case-image {
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 4px;
}

.modal-case-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Modal Case Info */
.modal-case-info {
    margin-bottom: 30px;
}

.modal-case-info .info-row {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.modal-case-info .info-row:first-child {
    border-top: 0px;
}

.modal-case-info .info-label,
.modal-case-info .info-value {
    padding: 18px 0px 18px 10px;
}

.modal-case-info .info-label {
    font-weight: 700;
    color: var(--primary-color);

    border-bottom: 1px solid var(--primary-color);
}

.modal-case-info .info-value {
    line-height: 1.6;
    border-bottom: 1px solid var(--secondary-border-color);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding-top: 20px;
}

/* Loading Skeleton */
.modal-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-image {
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 24px;
}

.skeleton-line {
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-line:nth-child(2) {
    width: 80%;
}

.skeleton-line:nth-child(3) {
    width: 60%;
}

.skeleton-button {
    width: 150px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 4px;
    margin: 24px auto 0;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Modal Error */
.modal-error {
    text-align: center;
    padding: 40px 20px;
}

.modal-error p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .case-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    #case-modal-body {
        padding: 30px 20px;
    }

    .modal-case-info .info-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 15px 0;
    }

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

    .modal-actions .btn-detail,
    .modal-actions .btn-back {
        width: 100%;
    }

    .skeleton-image {
        height: 200px;
    }
}

/* Accessibility */
.case-modal:focus {
    outline: none;
}

.case-modal-content:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}
