/* =========================================================
   CITATION MANAGER — PAGE-SPECIFIC STYLES
========================================================= */

/* =========================
   CITATION SECTION
========================= */

.citation-section {
    margin-top: 10px;
}

.citation-section .search-container {
    margin-bottom: 25px;
}


/* =========================
   PAPER LIST
========================= */

.paper-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


/* =========================
   CITATION PAPER CARD
========================= */

.citation-paper-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.citation-paper-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.citation-paper-info {
    min-width: 0;
    flex: 1;
}

.citation-paper-info h4 {
    margin: 0 0 7px;
    color: var(--text-heading);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.citation-paper-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.select-paper-button {
    flex-shrink: 0;
    border: none;
    background: var(--primary);
    color: white;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.select-paper-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}


/* =========================
   CITATION RESULT
========================= */

.citation-result {
    margin-top: 28px;
    padding: 22px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.citation-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.citation-label {
    display: block;
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
}

.citation-result-header h3 {
    max-width: 700px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
}

.citation-format-select,
.reference-format-select {
    flex-shrink: 0;
    min-width: 105px;
    padding: 6px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    background: #eff6ff;
    color: #2563eb;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.citation-format-select:focus,
.reference-format-select:focus {
    border-color: #93c5fd;
    box-shadow: var(--focus-ring);
}

.citation-box {
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
}

.apa-citation {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.citation-actions,
.reference-list-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.copy-citation-button {
    border: none;
    background: var(--primary);
    color: white;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.copy-citation-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.copy-status {
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
}

.citation-warnings {
    margin-top: 12px;
    padding: 11px 14px;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.6;
}

.citation-warnings strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}

.citation-warnings ul {
    margin: 5px 0 0 17px;
    padding: 0;
}


/* =========================
   MULTI-PAPER SELECTION
========================= */

.selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding: 14px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
}

.selection-summary div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.selection-summary strong {
    color: #1e3a8a;
    font-size: 13px;
}

.selection-summary span {
    color: var(--muted);
    font-size: 11px;
}

.generate-reference-button {
    flex-shrink: 0;
    border: none;
    background: #2563eb;
    color: white;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.generate-reference-button:hover {
    background: #1d4ed8;
}

.clear-selection-button {
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.clear-selection-button:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}


/* =========================
   REFERENCE LIST
========================= */

.reference-list-result {
    margin-top: 28px;
    padding: 22px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.reference-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.reference-list-header h3 {
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
}

.reference-list-container {
    padding: 18px 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
}

.reference-item {
    margin-bottom: 20px;
    padding-left: 28px;
    text-indent: -28px;
    color: #334155;
    font-size: 14px;
    line-height: 1.8;
}

.reference-item:last-child {
    margin-bottom: 0;
}

.reference-item a {
    color: inherit;
    text-decoration: none;
}

.reference-item a:hover {
    text-decoration: underline;
}

.reference-warning {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #fde68a;
    border-radius: 6px;
    background: #fffbeb;
    color: #92400e;
    font-size: 11px;
    line-height: 1.5;
    text-indent: 0;
}

.reference-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 120px;
    text-align: center;
    color: var(--muted);
}

.reference-empty strong {
    color: #334155;
    font-size: 14px;
}

.reference-empty span {
    max-width: 420px;
    font-size: 12px;
    line-height: 1.5;
}

.ieee-reference-number {
    display: inline-block;
    min-width: 28px;
    font-weight: 500;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {
    .citation-paper-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .select-paper-button {
        width: 100%;
    }

    .citation-result-header,
    .reference-list-header {
        flex-direction: column;
        gap: 10px;
    }

    .selection-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .generate-reference-button {
        width: 100%;
    }
}
