/* Scenario Detail Modal - Ultra Modern Design */

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d1b69 100%);
    border-radius: 20px;
    max-width: 1000px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(138, 43, 226, 0.3);
    border: 2px solid rgba(138, 43, 226, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-content.wide {
    max-width: 1000px;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 50px);
}

.close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 43, 226, 0.3) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 3px;
}

/* Main Layout Container */
.lorebook-detail-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Top Section - Image and Description */
.scenario-top-section {
    display: flex;
    gap: 2rem;
    min-height: 250px;
}

/* Cover Section */
.scenario-cover-section {
    flex-shrink: 0;
    width: 200px;
    height: 250px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scenario-cover-section .cover-design {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.scenario-cover-section .cover-design::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 50%, 
        transparent 80%, 
        rgba(255, 255, 255, 0.1) 80%);
    background-size: 20px 20px;
    animation: moveStripes 30s linear infinite;
}

.scenario-cover-section i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1;
}

.scenario-cover-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scenario-cover-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 1rem;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Description Section */
.scenario-description-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(138, 43, 226, 0.2);
    display: flex;
    flex-direction: column;
}

.scenario-description-section h4 {
    color: #a78bfa;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.scenario-description-content {
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 0.95rem;
    flex: 1;
    overflow-y: auto;
    max-height: 180px;
}

/* Middle Section with Info and Content */
.scenario-middle-section {
    display: flex;
    gap: 2rem;
}

/* Info Labels Column */
.scenario-info-column {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.info-label:hover {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(59, 130, 246, 0.3));
    transform: translateX(5px);
}

.info-label-key {
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.85rem;
}

.info-label-value {
    color: #e2e8f0;
    font-weight: 400;
    font-size: 0.85rem;
}

/* Content Section */
.scenario-content-section {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(138, 43, 226, 0.2);
    min-height: 250px;
}

.scenario-content-section h4 {
    color: #a78bfa;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    text-align: center;
}

.scenario-content-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    color: #94a3b8;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9rem;
}

/* Bottom Actions Section */
.scenario-actions-section {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(138, 43, 226, 0.2);
}

.scenario-command-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(138, 43, 226, 0.2);
    min-width: 280px;
}

.scenario-command-label {
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.85rem;
}

.scenario-command-code {
    flex: 1;
    font-family: 'Courier New', monospace;
    color: #10b981;
    font-size: 0.95rem;
    font-weight: 600;
}

.scenario-copy-btn {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.scenario-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* Rating Section */
.scenario-rating-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.rating-label {
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.85rem;
}

.rating-stars {
    display: flex;
    gap: 0.3rem;
}

.rating-stars .star {
    cursor: pointer;
    font-size: 1.2rem;
    color: rgba(251, 191, 36, 0.3);
    transition: all 0.2s ease;
}

.rating-stars .star:hover {
    transform: scale(1.2);
    color: #fbbf24;
}

.rating-stars .star.filled i {
    color: #fbbf24;
}

.rating-stars .star.filled i::before {
    content: '\f005';
    font-weight: 900;
}

.rating-stars .star:hover ~ .star {
    color: rgba(251, 191, 36, 0.3);
}

.rating-stars:hover .star {
    color: rgba(251, 191, 36, 0.3);
}

.rating-stars:hover .star:hover,
.rating-stars:hover .star:hover ~ .star:last-child {
    color: #fbbf24;
}

.rating-stars .star.hover-fill i::before {
    content: '\f005';
    font-weight: 900;
}

.rating-value {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 30px;
}

.scenario-action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario-action-btn.download {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.scenario-action-btn.download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.scenario-action-btn.report {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.scenario-action-btn.report:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

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

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

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .scenario-top-section {
        flex-direction: column;
    }
    
    .scenario-cover-section {
        width: 100%;
        height: 200px;
    }
    
    .scenario-middle-section {
        flex-direction: column;
    }
    
    .scenario-info-column {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .info-label {
        flex: 1;
        min-width: 150px;
    }
    
    .scenario-actions-section {
        flex-direction: column;
    }
}