/* ================================================
   SDX Journal Pins - Canvas Pin Styles
   ================================================ */

/* Context Menu - Dark theme with border-image frame */
.sdx-journal-pin-context-menu {
    background: #000000;
    border: var(--sdx-box-border-width, 8px) solid transparent;
    border-image: var(--sdx-box-border) var(--sdx-box-border-image-slice, 40) fill;
    border-image-repeat: stretch;
    border-image-width: var(--sdx-box-border-image-width, 40px);
    padding: 8px;
    min-width: 160px;
    font-family: 'Montserrat-medium', serif;
}

.sdx-journal-pin-menu-item {
    padding: 8px 14px;
    cursor: pointer;
    color: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    font-size: 14px;
}

.sdx-journal-pin-menu-item:hover {
    background-color: rgba(201, 170, 88, 0.3);
}

.sdx-journal-pin-menu-item i {
    width: 16px;
    text-align: center;
    color: #c9aa58;
}

.sdx-journal-pin-menu-item:hover i {
    color: #fff;
}

/* Tooltip - Dark theme with border-image frame (like player sheet) */
.sdx-journal-pin-tooltip {
    position: fixed;
    z-index: 10001;
    background: #000000;
    border: var(--sdx-box-border-width, 8px) solid transparent;
    border-image: var(--sdx-box-border) var(--sdx-box-border-image-slice, 40) fill;
    border-image-repeat: stretch;
    border-image-width: var(--sdx-box-border-image-width, 40px);
    padding: 12px 16px;
    max-width: 320px;
    font-family: 'Montserrat-medium', serif;
    pointer-events: none;
    animation: sdx-pin-tooltip-fade-in 0.2s ease;
}

@keyframes sdx-pin-tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sdx-journal-pin-tooltip-title {
    font-family: 'Old Newspaper Font', serif;
    font-size: 17px;
    font-weight: normal;
    color: #f0f0f0;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 1px 1px 2px #000;
}

.sdx-journal-pin-tooltip-content {
    font-size: 13px;
    color: #d0d0d0;
    line-height: 1.6;
    max-height: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .sdx-journal-pin-context-menu,
    .sdx-journal-pin-tooltip {
        border: 2px solid #fff !important;
        border-image: none !important;
    }
}

/* Pin List Application */
.pin-list-app .window-content {
    padding: 0;
    color: #000;
    display: flex;
    flex-direction: column;
}

.pin-list-app form {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pin-list-app .form-group {
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
    /* Do not grow */
}

.pin-list-app .notes {
    font-size: 13px;
    margin: 0;
    text-align: center;
    color: #444;
}

.pin-list-container {
    padding: 10px;
    flex: 1;
    /* Take remaining space */
    overflow-y: auto;
    height: auto;
    /* Allow flex to control height */
}

.sdx-pin-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pin-entry {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 5px;
    padding: 8px;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pin-entry:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pin-icon {
    flex: 0 0 32px;
    text-align: center;
    font-size: 18px;
    color: #444;
}

.pin-info {
    flex: 1;
    padding-left: 10px;
    line-height: 1.2;
}

.pin-name {
    font-weight: bold;
    font-size: 14px;
    color: #000;
}

.pin-page-name {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.pin-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 6px;
    justify-content: flex-start;
}

.pin-control {
    color: #666;
    font-size: 14px;
}

.pin-control:hover {
    color: #000;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

.border-radius-options {
    margin-top: 14px;
}

/* Dark mode overrides if needed */
.dark-mode .pin-list-app .window-content {
    background: #2e2e2e;
    color: #e0e0e0;
}

.dark-mode .pin-entry {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .pin-entry:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-mode .pin-name {
    color: #f0f0f0;
}

.dark-mode .pin-page-name {
    color: #aaa;
}