/**
 * Datatime Floating Button CSS
 * 
 * @since 1.0.0
 */

/* Základný wrapper */
.dttm-floating-button-wrapper {
    display: inline-block;
    position: relative;
    overflow: visible;
    /* Umožní zobrazenie obsahu mimo wrapper */
}

/* Hlavné tlačidlo */
.dttm-floating-button {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #ff0000;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: visible;
    /* Umožní zobrazenie rotujúceho textu mimo tlačidla */
}

/* Hover efekt */
.dttm-floating-button:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

/* Centrálny text */
.dttm-button-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    color: inherit;
    z-index: 2;
    word-wrap: break-word;
    max-width: 80%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Kontajner pre rotujúci text */
.dttm-rotating-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    overflow: visible;
    /* Umožní zobrazenie textu mimo kruhu */
}

/* Jednotlivé znaky rotujúceho textu */
.dttm-rotating-text span {
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    color: #0000ff;
    transform-origin: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* Responzívne nastavenia pre tablet */
@media (max-width: 1024px) {
    .dttm-floating-button {
        width: 130px;
        height: 130px;
    }

    .dttm-button-text {
        font-size: 12px;
    }

    .dttm-rotating-text span {
        font-size: 10px;
    }
}

/* Responzívne nastavenia pre mobil */
@media (max-width: 768px) {
    .dttm-floating-button {
        width: 120px;
        height: 120px;
    }

    .dttm-button-text {
        font-size: 11px;
    }

    .dttm-rotating-text span {
        font-size: 9px;
    }
}

/* Extra malé mobilné zariadenia */
@media (max-width: 480px) {
    .dttm-floating-button {
        width: 100px;
        height: 100px;
    }

    .dttm-button-text {
        font-size: 10px;
        max-width: 75%;
    }

    .dttm-rotating-text span {
        font-size: 8px;
    }
}

/* Elementor editor štýly */
.elementor-editor-active .dttm-floating-button {
    pointer-events: none;
}

.elementor-editor-active .dttm-floating-button:hover {
    transform: none;
}

/* Animácia pre rotujúci text */
@keyframes dttm-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Aplikovanie animácie na rotujúci text */
.dttm-rotating-text.dttm-animate {
    animation: dttm-rotate 10s linear infinite;
}

/* Focus štýly pre accessibility */
.dttm-floating-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Skrytie outline pre myš */
.dttm-floating-button:focus:not(:focus-visible) {
    outline: none;
}

/* Print štýly */
@media print {
    .dttm-floating-button-wrapper {
        display: none;
    }
}

/* Drag & Drop štýly */
.dttm-floating-button-wrapper.dttm-draggable {
    /* Začína ako relative - v toku dokumentu */
    position: relative;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dttm-floating-button-wrapper.dttm-draggable.dttm-sticky {
    /* Po začatí dragu sa zmení na fixed */
    position: fixed !important;
    z-index: 9999;
}

.dttm-floating-button-wrapper.dttm-draggable.dttm-dragging {
    opacity: 0.8;
    transform: scale(1.05);
}

.dttm-drag-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dttm-floating-button-wrapper.dttm-draggable:hover .dttm-drag-indicator {
    opacity: 1;
}

/* Drag handle štýly */
.dttm-floating-button-wrapper[data-drag-handle="center"] .dttm-floating-button {
    cursor: default;
}

.dttm-floating-button-wrapper[data-drag-handle="center"] .dttm-button-text {
    cursor: move;
}

.dttm-floating-button-wrapper[data-drag-handle="edge"] .dttm-floating-button {
    cursor: default;
}

.dttm-floating-button-wrapper[data-drag-handle="edge"]::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px dashed rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: move;
}

.dttm-floating-button-wrapper[data-drag-handle="edge"]:hover::before {
    opacity: 1;
}

/* Auto-sticky štýly */
.dttm-floating-button-wrapper.dttm-auto-sticky {
    position: fixed !important;
    z-index: 9999;
    transition: all 0.3s ease-out;
}

.dttm-floating-button-wrapper[data-auto-sticky="true"] {
    transition: all 0.3s ease-out;
}

/* Responzívne úpravy pre drag & drop */
@media (max-width: 768px) {
    .dttm-drag-indicator {
        width: 24px;
        height: 24px;
        font-size: 12px;
        top: -12px;
        right: -12px;
    }

    .dttm-floating-button-wrapper.dttm-draggable:hover .dttm-drag-indicator {
        opacity: 1;
    }
}

/* Sticky Scale štýly */
.dttm-floating-button-wrapper.dttm-auto-sticky,
.dttm-floating-button-wrapper.dttm-sticky {
    /* Umožní plynulé scale transitions */
    will-change: transform;
    transform-origin: center center;
}

/* Smooth scaling pre sticky elementy */
.dttm-floating-button-wrapper[data-auto-sticky="true"] {
    transition: all 0.3s ease-out, transform 0.3s ease-out;
}

.dttm-floating-button-wrapper.dttm-draggable.dttm-sticky {
    transition: transform 0.3s ease-out;
}

/* Responzívne optimalizácie pre sticky scale */
@media (max-width: 768px) {
    /* Na mobile zariadeniach môže byť scale menej nápadný */
    .dttm-floating-button-wrapper.dttm-auto-sticky,
    .dttm-floating-button-wrapper.dttm-sticky {
        /* Zachovanie optimálnej veľkosti na malých obrazovkách */
        min-width: 80px;
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    /* Extra malé zariadenia - jemnejšie scaling */
    .dttm-floating-button-wrapper.dttm-auto-sticky,
    .dttm-floating-button-wrapper.dttm-sticky {
        /* Obmedziť príliš malé scale hodnoty */
        min-width: 70px;
        min-height: 70px;
    }
}