/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.856);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Container */
.modal-container {
    background: #ffffff;
    border-radius: 8px;
    width: calc(100% - 40px);
    max-width: 900px;
    height: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.205);
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background: #ffffff;
    flex-shrink: 0;
}

/* Modal Body - scrollable */
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-header h3 {
    margin: 0;
    color: #181717;
    font-size: 1.1em;
}

.modal-close {
    background: none;
    border: none;
    color: #181717;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #ff3131;
}

.modal-copy {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #ccc;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.modal-copy:hover {
    background: #4a4a4a;
    color: #fff;
}

.modal-copy.copied {
    background: #2e7d32;
    border-color: #4caf50;
}

/* Code Block */
.code-block {
    background: #2d2d2d;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #d4d4d4;
}

.code-block pre {
    margin: 0;
    white-space: pre;
}

/* C# Syntax Highlighting */
.cs-keyword {
    color: #569cd6;
}

.cs-type {
    color: #4ec9b0;
}

.cs-string {
    color: #ce9178;
}

.cs-number {
    color: #b5cea8;
}

.cs-comment {
    color: #6a9955;
}

.cs-method {
    color: #dcdcaa;
}

.cs-attribute {
    color: #9cdcfe;
}

.cs-unity-method {
    color: #c586c0;
}

/* Snippet Button */
.snippet-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    vertical-align: middle;
}

.snippet-btn:hover {
    opacity: 0.7;
}

/* Markdown Content Styles */
.md-content h2 {
    color: #181717;
    font-size: 1.4em;
    margin: 25px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

.md-content h3 {
    color: #3f3d3d;
    font-size: 1.15em;
    margin: 20px 0 10px 0;
}

.md-content p {
    color: #181717;
    line-height: 1.6;
    margin: 10px 0;
}

.md-content code {
    background: #3a3a3a;
    color: #e6db74;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.md-content strong {
    color: #181717;
}

.md-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

.md-content ol,
.md-content ul {
    color: #181717;
    margin: 10px 0;
    padding-left: 25px;
    line-height: 1.8;
}

.md-content li {
    margin: 5px 0;
}

/* Tables */
.md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9em;
}

.md-content th,
.md-content td {
    border: 1px solid #444;
    padding: 8px 12px;
    text-align: left;
}

.md-content th {
    background: #333;
    color: #fff;
    font-weight: 600;
}

.md-content td {
    color: #ccc;
    background: #2a2a2a;
}

.md-content tr:hover td {
    background: #333;
}

/* Code Block Wrapper with Copy Button */
.code-wrapper {
    position: relative;
    margin: 15px 0;
}

.code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #3a3a3a;
    border: 1px solid #555;
    color: #ccc;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 1;
}

.code-copy:hover {
    opacity: 1;
    background: #4a4a4a;
    color: #fff;
}

.code-copy.copied {
    background: #2e7d32;
    border-color: #4caf50;
    opacity: 1;
}
