:root {
    --share-card-bg: #1a1a1a;
    --share-card-text: #e0e0e0;
    --share-card-accent: #a0a0a0;
    --share-btn-bg: #333;
    --share-btn-hover: #555;
}

/* Tooltip Button */
#share-tooltip {
    position: absolute;
    background-color: var(--share-btn-bg);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    z-index: 1000;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    user-select: none;
    transition: opacity 0.2s;
}

#share-tooltip:hover {
    background-color: var(--share-btn-hover);
}

#share-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--share-btn-bg) transparent transparent transparent;
}

/* Hidden Card Container (Off-screen but rendered) */
#share-card-container {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 400px;
    /* Fixed width for consistency */
    border-radius: 0;
    /* Square corners as per image */
    overflow: hidden;
}

#share-card {
    background-color: #000;
    color: #fff;
    padding: 30px;
    padding-bottom: 40px;
    box-sizing: border-box;
    /* font-family will be set via JS to match content */
    display: flex;
    flex-direction: column;
    gap: 20px;
    line-height: 1.6;
}

.card-header {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.card-content {
    font-size: 18px;
    text-align: justify;
    min-height: 100px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.8;
    /* Preserve formatting */
}

.card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #bbb;
    font-family: sans-serif;
    max-width: 70%;
    line-height: 1.4;
}

.card-meta div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-bottom: 4px;
    line-height: 1.6;
}

.card-qrcode {
    width: 80px;
    height: 80px;
    background: white;
    /* QR code needs contrast */
    padding: 5px;
    box-sizing: border-box;
}

/* Modal for Result */
#share-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#share-modal.show {
    display: flex;
}

.modal-content {
    background-color: transparent;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 35px;
    cursor: pointer;
}

.modal-tip {
    color: #fff;
    margin-top: 10px;
    font-size: 14px;
}

/* Highlight selected text color selection */
::selection {
    background: rgba(100, 180, 255, 0.4);
    color: #fff;
}

::-moz-selection {
    background: rgba(100, 180, 255, 0.4);
    color: #fff;
}