﻿/*!
  Datei: cpKey.css
  Beschreibung: Styles für das cp-key-function Widget
  Abhängigkeit: WebComponentsIcons Font muss geladen sein
*/

@font-face {
    font-family: 'WebComponentsIcons';
    src: url('../../Kendo/fonts/glyphs/WebComponentsIcons.ttf') format('truetype');
}



/* start cp-key*/

.cp-key-function {
    position: relative;
    display: inline-block;
    overflow: hidden;
    cursor: pointer;
    /* touch-action: none;  ← DAS MUSS WEG oder ersetzt werden */
    touch-action: manipulation; /* ← BESSER */
    border-radius: var(--cp-radius, 18px);
    /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);*/
    user-select: none;
}



.cp-key-bg {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}

.cp-key-left,
.cp-key,
.cp-key-right {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.cp-key-left {
    width: 24%;
    background: transparent;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
}

.cp-key {
    flex-grow: 1;
    text-align: center;
    padding: 0 8px;
    background: transparent;
    font-weight: bold;
    font-size: 1.5em;
    color: white;
}

.cp-key-right {
    width: 20%;
    background: transparent;
    border-top-right-radius: inherit;
    border-bottom-right-radius: inherit;
}

.cp-key-codepoint {
    font-family: WebComponentsIcons;
    font-size: 1.5em;
    pointer-events: none;
}

.cp-key-image {
    max-width: 60%;
    max-height: 60%;
    opacity: 0.9;
    pointer-events: none;
}

.cp-key-left .cp-key-image,
.cp-key-right .cp-key-image {
    object-fit: contain;
    max-width: 80%;
    max-height: 80%;
    display: block;
    margin: auto;
}

.cp-key-left {
    margin-right: 2px;
}


.cp-key-label {
    font-size: 1em;
    line-height: 1.2em;
    font-weight: bold;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left;
}

.cp-key-badge {
    background-color: red;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75em;
    margin-left: 4px;
    white-space: nowrap;
}

.cp-key-glossy-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.05) 60%, rgba(0, 0, 0, 0.05) 100%), radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0.1) 100%);
    background-blend-mode: screen;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.cp-key-function.selected .cp-key-glossy-overlay {
    opacity: 1;
    box-shadow: 0 0 8px 4px rgba(255, 255, 128, 0.4);
}

.cp-key-glossy-overlay:not(.selected) {
    opacity: 0.2;
    box-shadow: none;
}


/* end cp-key*/

/* start cp-key container */

.cp-key-scroll-wrapper {
    position: relative;
    width: 100%;
}

.cp-key-group-scrollable {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    touch-action: pan-x;
    padding-bottom: 4px; /* Abstand für mobiles Scrollgefühl */
    scrollbar-width: none; /* Firefox: Scrollbar ausblenden */
}

    .cp-key-group-scrollable::-webkit-scrollbar {
        display: none; /* Chrome/Safari: Scrollbar ausblenden */
    }

.cp-key-group-horizontal {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    /*padding: 4px 0;*/
}

    .cp-key-group-horizontal .cp-key-function {
        flex-shrink: 0;
        min-width: unset;
    }

/* Desktop: Scrollbar nur bei Hover sichtbar */
@media (pointer: fine) {
    .cp-key-group-scrollable {
        overflow-x: hidden;
    }

        .cp-key-group-scrollable:hover {
            overflow-x: auto;
        }
}

/* Pfeile links/rechts */
.cp-key-scroll-left,
.cp-key-scroll-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    background: rgba(255,255,255,0.7);
    color: #333;
    cursor: pointer;
    z-index: 5;
    user-select: none;
    transition: opacity 0.2s ease;
}

.cp-key-scroll-left {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

.cp-key-scroll-right {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

/* end cp-key container */
