/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Content Area */
.modal-content {
    display: flex;
    background-color: #23233d; /* Slightly lighter dark blue */
    color: #e0e0e0;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 800px; /* Max width of the modal */
    max-height: 90vh; /* Max height */
    overflow-y: auto; /* Allow scrolling if content exceeds height */
    position: relative; /* For positioning the close button */
    gap: 25px; /* Space between image column and info column */
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4a4a70;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: background-color 0.3s ease;
}
.modal-close-btn:hover {
    background-color: #ff9900; /* Orange accent on hover */
    color: #1a1a2e;
}

/* Left Column: Card Image and Core Info */
.modal-left-column {
    flex: 0 0 280px; /* Fixed width for image column */
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-card-image-lg {
    width: 100%;
    border-radius: 10px; /* Rounded corners for the large image */
    background-color: #3b3b63; /* Placeholder bg */
    min-height: 380px; /* Placeholder height */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.modal-card-image-lg img {
    width: 100%;
    height: auto;
    display: block;
}
.modal-core-info .info-item {
    margin-bottom: 8px;
    font-size: 0.95em;
}
.modal-core-info .info-item .label {
    color: #a0a0a0;
    display: inline-block;
    width: 70px; /* Align labels */
}
.modal-core-info .info-item .value {
    color: #e0e0e0;
    font-weight: 500;
}
.modal-core-info .info-item .value.rarity-SR { color: #ffcc00; } /* Example rarity color */
.modal-core-info .info-item .value.rarity-SEC { color: #ff6666; } /* Example rarity color */
.modal-core-info .info-item .value.rarity-L { color: #ff9900; }
.banned-status {
    background-color: #c0392b; /* Red for banned */
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 5px;
}


/* Right Column: Details, Text, Market */
.modal-right-column {
    flex: 1; /* Takes remaining space */
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-size: 0.9em;
}

.modal-card-name-id {
    margin-bottom: 5px;
}
.modal-card-name-id .card-name-lg {
    margin: 0px;
    font-size: 1.8em;
    font-weight: bold;
    color: #ff9900; /* Orange accent for name */
    line-height: 1.2;
}
.modal-card-name-id .card-id-lg {
    font-size: 0.95em;
    color: #a0a0a0;
    margin-top: 2px;
}
.modal-card-name-id .card-id-lg {
    font-size: 0.95em;
    color: #a0a0a0;
    margin-top: 2px;
}

.modal-section {
    background-color: #2c2c54; /* Slightly darker for sections */
    padding: 15px;
    border-radius: 6px;
}
.modal-section h4 {
    color: #ff9900;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #4a4a70;
}
.modal-section .effect-text, .modal-section .trigger-text {
    color: #d0d0d0;
    line-height: 1.5;
    white-space: pre-wrap; /* Preserve line breaks in effect text */
    font-size: 0.95em;
}
.modal-section .trigger-text {
    border-left: 3px solid #ff9900;
    padding-left: 10px;
    margin-top: 10px;
    font-style: italic;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.modal-details-grid .detail-item .label {
    color: #a0a0a0;
}
.modal-details-grid .detail-item .value {
    color: #e0e0e0;
    font-weight: 500;
}
.modal-details-grid .detail-item .value.color-red { color: #ff7373; }
.modal-details-grid .detail-item .value.color-green { color: #73ff73; }
.modal-details-grid .detail-item .value.color-blue { color: #73b9ff; }
/* Add more colors */


.market-info .market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.market-info .market-item .label { color: #a0a0a0; }
.market-info .market-item .value { color: #e0e0e0; font-weight: 500; }

.market-last-updated {
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
    display: flex;
    align-items: center;
}
.refresh-market-btn {
    background: none;
    border: none;
    color: #ff9900;
    cursor: pointer;
    margin-left: 8px;
    font-size: 1.1em; /* For icon size */
    padding: 0;
}
.refresh-market-btn:hover { color: #e68a00; }

.buy-card-link {
    display: inline-block;
    background-color: #ff9900;
    color: #1a1a2e;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    transition: background-color 0.3s ease;
    width: auto;
}
.buy-card-link:hover {
    background-color: #e68a00;
}

/* Scrollbar styling for webkit browsers */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: #2c2c54;
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #4a4a70;
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #5a5a80;
}

/* Responsive adjustments for the modal */
@media (max-width: 768px) {
    .modal-content {
        flex-direction: column;
        max-height: 85vh; /* Adjust height for smaller screens */
        gap: 20px;
    }
    .modal-left-column {
        flex: 0 0 auto; /* Allow it to shrink if needed */
        align-items: center; /* Center image on smaller screens */
    }
    .modal-card-image-lg {
        width: 200px; /* Smaller image on mobile */
        min-height: 280px;
    }
    .modal-card-name-id .card-name-lg {
        font-size: 1.5em;
    }
    .card-id-overlay {
        font-size: 0.8em;
    }
}

/* Blur effect for page content when modal is active */
.page-blurred {
    filter: blur(3px);
    transition: filter 0.3s ease-out;
}

textarea.form-control.form-control-sm {
  width: 100%;
}