/* SaveToFav Styles */

#stf-pinboard-app {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
}

/* Header */
.stf-pinboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 2px solid #e0e0e0;
}

.stf-pinboard-user-info {
    font-size: 16px;
}

.stf-pinboard-user-info .username {
    font-weight: bold;
    margin-right: 10px;
}

.stf-pinboard-user-info .pin-count {
    color: #666;
}

/* Container Layout */
.stf-pinboard-container {
    display: flex;
    gap: 30px;
}

.stf-pinboard-left-panel {
    flex: 2;
    min-width: 0;
}

.stf-pinboard-right-panel {
    flex: 1;
    min-width: 250px;
}

/* Buttons */
.stf-pin-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.stf-pin-btn-primary {
    background-color: #007bff;
    color: white;
}

.stf-pin-btn-primary:hover {
    background-color: #0056b3;
}

.stf-pin-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.stf-pin-btn-secondary:hover {
    background-color: #545b62;
}

.stf-pin-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.stf-pin-btn-danger {
    background-color: #dc3545;
    color: white;
}

.stf-pin-btn-danger:hover {
    background-color: #c82333;
}

.stf-pin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form */
.stf-pin-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stf-pin-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.stf-form-group {
    margin-bottom: 15px;
}

.stf-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.stf-form-group input[type="text"],
.stf-form-group input[type="url"],
.stf-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.stf-form-group input:focus,
.stf-form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.stf-form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.stf-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Tag Input with Autocomplete */
.stf-tag-input-wrapper {
    position: relative;
}

.stf-tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stf-tag-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.stf-tag-suggestion:hover,
.stf-tag-suggestion.active {
    background-color: #f0f0f0;
}

/* Pins List */
.stf-pins-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stf-pin-item {
    background: white;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: box-shadow 0.2s;
    display: flex;
    gap: 15px;
}

.stf-pin-thumbnail-link {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    display: block;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.stf-pin-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stf-pin-content {
    flex: 1;
    min-width: 0;
}

.stf-pin-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stf-pin-title {
    font-size: 16px;
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0;
}

.stf-pin-title:hover {
    text-decoration: underline;
}

.stf-pin-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.stf-pin-url {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stf-pin-copy-btn {
    border: none;
    background: transparent;
    padding: 2px;
    cursor: pointer;
    font-size: 16px;
    color: #6c757d;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.stf-pin-copy-btn:hover {
    color: #007bff;
    transform: scale(1.1);
}

.stf-pin-copy-btn.copied {
    color: #28a745;
}

.stf-pin-url {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    word-break: break-all;
}

.stf-pin-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.stf-pin-note-icon {
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s;
}

.stf-pin-note-icon:hover {
    transform: scale(1.2);
}

.stf-pin-date {
    color: #999;
}

.stf-pin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.stf-pin-tag {
    background: #e9ecef;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.stf-pin-tag:hover {
    background: #007bff;
    color: white;
}

.stf-pin-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

/* Search Box */
.stf-search-box {
    margin-bottom: 20px;
}

.stf-search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.stf-search-box input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Tag Cloud */
.stf-tag-cloud {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.stf-tag-cloud h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
}

.stf-tag-cloud-content {
    line-height: 1.4;
}

.stf-cloud-tag {
    display: inline-block;
    margin: 2px 4px;
    cursor: pointer;
    color: #007bff;
    transition: all 0.2s;
}

.stf-cloud-tag:hover {
    color: #0056b3;
    text-decoration: underline;
}

.stf-cloud-tag.active {
    color: #dc3545;
    font-weight: bold;
}

/* Selected Tags */
.stf-selected-tags {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.stf-selected-tags strong {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

#selected-tags-list {
    margin-bottom: 10px;
}

.stf-selected-tag {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
}

/* Modal */
.stf-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.5);
}

.stf-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

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

.stf-modal-close:hover {
    color: #333;
}

#note-modal-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

#note-modal-body {
    line-height: 1.6;
    color: #333;
}

/* Loading and Empty States */
.stf-loading,
.stf-no-pins,
.stf-no-tags {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

.stf-pinboard-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
}

/* Share Button */
.stf-pin-btn-share {
    background-color: #17a2b8;
    color: white;
}

.stf-pin-btn-share:hover {
    background-color: #138496;
}

/* Share Badge */
.stf-share-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

/* Share Modal */
.stf-share-pin-title {
    font-weight: 600;
    color: #007bff;
    margin-bottom: 15px;
}

.stf-share-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.stf-share-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Inbox Modal (wider) */
.stf-modal-content-wide {
    max-width: 700px;
}

/* Inbox Items */
.stf-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stf-inbox-item {
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.stf-inbox-item .stf-pin-title {
    display: block;
    margin-bottom: 5px;
}

.stf-inbox-sender {
    font-size: 13px;
    color: #666;
    margin-bottom: 3px;
}

.stf-inbox-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.stf-inbox-tags-group {
    margin-bottom: 10px;
}

.stf-inbox-tags-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stf-inbox-tags-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.stf-inbox-tags-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.stf-inbox-actions {
    display: flex;
    gap: 8px;
}

.stf-inbox-note {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stf-pinboard-container {
        flex-direction: column;
    }

    .stf-pinboard-right-panel {
        order: -1;
    }

    .stf-pinboard-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .stf-pin-item {
        flex-direction: column;
    }

    .stf-pin-thumbnail-link {
        width: 100%;
        height: 150px;
    }

    .stf-pin-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .stf-pin-actions {
        margin-left: 0;
        width: 100%;
    }
}
