/* --- Base Styles --- */
.ix-cite-modal *{
	font-family: 'MyriadProIXWeb';
}
.ix-citation-block {
    margin: 8px 0px 0px;
    font-size: 13px;
    line-height: 1.4;
}

.doi-link {
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.doi-link:hover {
    text-decoration: underline;
    opacity: 0.7;
}

/* Main Page Buttons */
.ix-citation-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.ix-cite-btn {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

.ix-cite-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
}

#ix-open-cite-modal {
    border: 1.5px solid #696969;
    color: #696969;
}

#ix-open-cite-modal:hover {
    background: rgba(5, 116, 219, 0.05);
    box-shadow: none;
}

#ix-open-cite-modal:active, #ix-open-cite-modal:visited, #ix-open-cite-modal:focus, .ix-cite-tab:active,
.ix-cite-tab:visited, .ix-cite-tab:focus, .ix-cite-tab:hover, .ix-modal-action-btn:hover,
.ix-modal-action-btn:active, .ix-modal-action-btn:visited, .ix-modal-action-btn:focus,
#ix-close-cite-modal:active, #ix-close-cite-modal:visited, #ix-close-cite-modal:focus, #ix-close-cite-modal:hover{
    box-shadow: none;
}


#dl-pdf {
    border: 1.5px solid #df002a;
    color: #df002a;
}

#dl-pdf:hover {
    color: #df002a;
    border-color: #df002a;
    background: rgba(255, 7, 7, 0.05);
}

/* --- Modal Styles --- */
.ix-cite-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ix-cite-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ix-cite-modal {
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-top: 5px solid #df002a;
    overflow: hidden;
}

.ix-cite-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.ix-cite-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.ix-cite-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0 5px;
}

.ix-cite-modal-close:hover {
    color: #000;
}

.ix-cite-modal-body {
    padding: 20px;
}

.ix-cite-modal-brand img{
    height: 24px;
}

.ix-cite-modal-instruction {
    text-align: center;
    color: #555;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 13px;
}

/* Modal Tabs */
.ix-cite-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.ix-cite-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    text-transform: none;
    letter-spacing: normal;
    background-color: #fcfcfc;
}

.ix-cite-tab:hover {
    color: #333;
    background-color: #f5f5f5;
}

.ix-cite-tab.active {
    color: #000;
    border-bottom-color: #df002a;
}

/* Modal Actions Row */
.ix-cite-actions-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ix-modal-action-btn {
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.2s;
}

.ix-modal-action-btn:hover {
    color: #000;
}

.ix-modal-divider {
    color: #ccc;
    font-size: 12px;
}

/* Modal Output Area */
.ix-cite-text-box {
    background: #fcfcfc;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px;
    min-height: 60px;
    max-height: 250px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}

.ix-cite-output {
    margin: 0;
    color: #333;
    font-family: 'MyriadProIXWeb';
    white-space: pre-wrap; /* Preserves the line breaks we added in JS, but wraps text */
    word-wrap: break-word; /* Forces long URLs to break onto the next line */
    overflow-x: auto;
}

.ix-cite-loader {
    text-align: center;
    color: #888;
    margin-top: 40px;
    margin-bottom: 40px;
    font-style: italic;
}

/* Responsive Main Buttons */
@media (max-width: 600px) {
    .ix-citation-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 150px));
    }

    .ix-cite-btn {
        width: 100%;
        padding: 10px 8px;
        font-size: 12px;
        max-width: 150px;
    }

    /* If there is no PDF button, center the 'Cite This' button */
    .ix-citation-buttons:has(> :only-child) {
        grid-template-columns: minmax(0, 150px);
    }
}