/**
 * DokuWiki Plugin myshortcuts (CSS Styles)
 *
 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
 * @author David Jiménez <davidjimenez75@gmail.com>
 */

/* Overlay for snippet dialog */
.myshortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dialog box */
.myshortcuts-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dialog header */
.myshortcuts-dialog h3 {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.2em;
    color: #333;
}

/* Snippet list container */
.myshortcuts-snippet-list {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}

/* Individual snippet item */
.myshortcuts-snippet-item {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 12px 15px;
    margin: 5px 0;
    text-align: left;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.myshortcuts-snippet-item:hover,
.myshortcuts-snippet-item:focus {
    background: #e8f4f8;
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

/* Key indicator badge */
.myshortcuts-key-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: #4a90e2;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.myshortcuts-snippet-item:hover .myshortcuts-key-indicator,
.myshortcuts-snippet-item:focus .myshortcuts-key-indicator {
    background: #357abd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Snippet content container */
.myshortcuts-snippet-content {
    flex: 1;
    min-width: 0;
}

.myshortcuts-snippet-item strong {
    display: block;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.myshortcuts-snippet-preview {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button */
.myshortcuts-close-btn {
    margin: 15px 20px 20px;
    padding: 10px 20px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.myshortcuts-close-btn:hover {
    background: #e0e0e0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .myshortcuts-dialog {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .myshortcuts-dialog h3 {
        color: #e0e0e0;
        border-bottom-color: #444;
    }

    .myshortcuts-snippet-item {
        background: #3a3a3a;
        border-color: #555;
    }

    .myshortcuts-snippet-item:hover,
    .myshortcuts-snippet-item:focus {
        background: #4a4a4a;
        border-color: #6a9bd8;
    }

    .myshortcuts-key-indicator {
        background: #6a9bd8;
    }

    .myshortcuts-snippet-item:hover .myshortcuts-key-indicator,
    .myshortcuts-snippet-item:focus .myshortcuts-key-indicator {
        background: #5080c0;
    }

    .myshortcuts-snippet-item strong {
        color: #e0e0e0;
    }

    .myshortcuts-snippet-preview {
        color: #aaa;
    }

    .myshortcuts-close-btn {
        background: #3a3a3a;
        border-color: #555;
        color: #e0e0e0;
    }

    .myshortcuts-close-btn:hover {
        background: #4a4a4a;
    }
}
