/* Quick Buttons Panel */
.quick-buttons-panel {
    position: fixed;
    right: 20px;
    top: 280px;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    z-index: 900;
    max-width: 220px;
    min-width: 180px;
    transition: all 0.3s ease;
}

.quick-buttons-header {
    display: none;
}

.quick-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-btn {
    background: rgba(40, 40, 50, 0.95);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    padding-right: 36px;
    cursor: grab;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 36px;
    max-height: 36px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.quick-btn.dragging {
    cursor: grabbing;
}

.quick-btn:hover:not(:disabled) {
    background: rgba(50, 50, 60, 1);
    border-color: rgba(255, 152, 0, 0.5);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.quick-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.quick-btn:disabled {
    display: none;
}

.quick-btn.empty {
    display: none;
}

.quick-btn.assigned {
    display: block !important; /* Always show assigned buttons */
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.quick-btn.assigned:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.35);
    border-color: rgba(76, 175, 80, 0.7);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.quick-btn-number {
    display: none;
}

.quick-btn-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
    line-height: 1.2;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    font-weight: 500;
    padding: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    pointer-events: none; /* Label doesn't intercept events */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.quick-btn-label::-webkit-scrollbar {
    display: none;
}

.quick-btn.assigned .quick-btn-label {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

/* Route indicator icon */
.quick-btn[data-type="route"]::before {
    content: '🗺️';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Place indicator icon */
.quick-btn[data-type="place"]::before {
    content: '📍';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Loading animation */
.quick-btn.loading {
    pointer-events: none;
}

.quick-btn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 152, 0, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .quick-buttons-panel {
        right: 10px;
        top: 270px;
        max-width: 200px;
        min-width: 160px;
        padding: 0;
    }
    
    .quick-buttons-grid {
        gap: 5px;
    }
    
    .quick-btn {
        min-height: 32px;
        max-height: 32px;
        padding: 6px 10px;
        padding-right: 32px;
    }
    
    .quick-btn-label {
        font-size: 11px;
    }
    
    .quick-btn[data-type="route"]::before,
    .quick-btn[data-type="place"]::before {
        font-size: 14px;
        right: 8px;
    }
}

@media (max-width: 768px) {
    .quick-buttons-panel {
        right: 10px;
        left: auto;
        transform: none;
        bottom: auto;
        top: 270px;
        max-width: calc(10vw - 20px);
        min-width: 140px;
        padding: 0;
    }
    
    .quick-buttons-grid {
        gap: 4px;
    }
    
    .quick-btn {
        min-height: 30px;
        max-height: 30px;
        padding: 5px 8px;
        padding-right: 28px;
    }
    
    .quick-btn-label {
        font-size: 10px;
    }
    
    .quick-btn[data-type="route"]::before,
    .quick-btn[data-type="place"]::before {
        font-size: 12px;
        right: 6px;
    }
}

@media (max-width: 480px) {
    .quick-buttons-panel {
        right: 8px;
        top: 265px;
        max-width: calc(10vw - 16px);
        min-width: 120px;
        padding: 0;
    }
    
    .quick-buttons-grid {
        gap: 4px;
    }
    
    .quick-btn {
        min-height: 28px;
        max-height: 28px;
        padding: 4px 6px;
        padding-right: 26px;
    }
    
    .quick-btn-label {
        font-size: 9px;
    }
    
    .quick-btn[data-type="route"]::before,
    .quick-btn[data-type="place"]::before {
        font-size: 11px;
        right: 5px;
    }
}

/* Desktop Large Screens */
@media (min-width: 1400px) {
    .quick-buttons-panel {
        max-width: 240px;
        min-width: 200px;
        padding: 0;
    }
    
    .quick-buttons-grid {
        gap: 6px;
    }
    
    .quick-btn {
        min-height: 38px;
        max-height: 38px;
        padding: 9px 14px;
        padding-right: 38px;
    }
    
    .quick-btn-label {
        font-size: 13px;
    }
    
    .quick-btn[data-type="route"]::before,
    .quick-btn[data-type="place"]::before {
        font-size: 17px;
        right: 11px;
    }
}

/* ========================================
   CYCLIC MODE STYLES
   ======================================== */

/* Cyclic Mode Active - пульсирующая анимация */
.quick-btn.cyclic-active {
    background: rgba(78, 204, 163, 0.3) !important;
    border: 2px solid rgba(78, 204, 163, 0.8) !important;
    animation: cyclicPulse 2s ease-in-out infinite;
}

.quick-btn.cyclic-active:hover {
    background: rgba(78, 204, 163, 0.4) !important;
    border-color: rgba(78, 204, 163, 1) !important;
}

.quick-btn.cyclic-active .quick-btn-label {
    color: rgba(255, 255, 255, 1);
    font-weight: 700;
}

/* Cyclic indicator - добавляем иконку цикла */
.quick-btn.cyclic-active::after {
    content: '🔄';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    animation: spin 3s linear infinite;
    filter: drop-shadow(0 0 3px rgba(78, 204, 163, 0.8));
}

@keyframes cyclicPulse {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(78, 204, 163, 0.4),
            0 0 20px rgba(78, 204, 163, 0.2),
            0 2px 8px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(78, 204, 163, 0.8),
            0 0 40px rgba(78, 204, 163, 0.4),
            0 4px 16px rgba(78, 204, 163, 0.3);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Long Press Detection - визуальная индикация */
.quick-btn.long-press-detected {
    transform: scale(0.95);
    box-shadow: 
        inset 0 0 10px rgba(78, 204, 163, 0.5),
        0 0 15px rgba(78, 204, 163, 0.6);
}

/* ======================================== */

