/* Document Bookmark Block Frontend Styles */

/* Ensure dashicons are properly displayed */
.document-bookmark-block .dashicons,
.document-bookmark-block .dashicons::before {
    font-family: 'dashicons' !important;
    display: inline-block;
    line-height: 1;
    font-weight: 400;
    font-style: normal;
    speak: none;
    text-decoration: inherit;
    text-transform: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.document-bookmark-block {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.document-bookmark-block:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.document-bookmark-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .document-bookmark-inner {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Document Icon */
.document-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.document-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #495057;
}

/* Document Info */
.document-info {
    flex: 1;
    min-width: 0;
}

.document-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    word-wrap: break-word;
}

.document-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #6c757d;
}

.document-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.file-type {
    padding: 2px 6px;
    background: #007cba;
    color: white;
    border-radius: 3px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.file-size::before {
    content: "•";
    margin-right: 4px;
    color: #adb5bd;
}

.document-category {
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 3px;
    color: #495057;
}

/* Document Actions */
.document-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .document-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .document-actions > * {
        flex: 1;
        justify-content: center;
    }
}

.document-download-btn,
.document-bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

/* Download Button */
.document-download-btn {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.document-download-btn:hover {
    background: #218838;
    border-color: #1e7e34;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.document-download-btn:active {
    transform: translateY(0);
}

.document-download-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Bookmark Button */
.document-bookmark-btn {
    background: white;
    color: #495057;
    border-color: #dee2e6;
}

.document-bookmark-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.document-bookmark-btn.bookmarked {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.document-bookmark-btn.bookmarked:hover {
    background: #e0a800;
    border-color: #d39e00;
}

.document-bookmark-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.document-bookmark-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.document-bookmark-btn.loading .dashicons::before {
    content: "\f463";
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* States and Feedback */
.document-bookmark-placeholder,
.document-bookmark-error {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-style: italic;
}

.document-bookmark-error {
    border-color: #dc3545;
    color: #dc3545;
    background: #f8d7da;
}

/* Alignments */
.wp-block-document-bookmarks-document-bookmark.alignwide .document-bookmark-block {
    margin-left: calc(25% - 25vw);
    margin-right: calc(25% - 25vw);
}

.wp-block-document-bookmarks-document-bookmark.alignfull .document-bookmark-block {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}