/**
 * Floating Button Styles
 * Easy-to-use floating action buttons for any page
 */

/* Base Floating Button */
.floating-button {
    position: fixed;
    z-index: 9999;
    padding: 16px 24px;
    border-radius: 50px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.floating-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.floating-button:active {
    transform: translateY(-1px);
}

/* Position Variants */
.floating-button.bottom-right {
    bottom: 30px;
    right: 30px;
}

.floating-button.bottom-left {
    bottom: 30px;
    left: 30px;
}

.floating-button.top-right {
    top: 30px;
    right: 30px;
}

.floating-button.top-left {
    top: 30px;
    left: 30px;
}

.floating-button.bottom-center {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.floating-button.bottom-center:hover {
    transform: translateX(-50%) translateY(-3px);
}

/* Color Variants */
.floating-button.primary {
    background: linear-gradient(135deg, #00CEC9 0%, #00b5b1 100%);
    color: #000000;
}

.floating-button.primary:hover {
    color: #000000;
}

.floating-button.secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.floating-button.secondary:hover {
    color: #ffffff;
}

.floating-button.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff;
}

.floating-button.success:hover {
    color: #ffffff;
}

.floating-button.danger {
    background: linear-gradient(135deg, #FF5252 0%, #ff3838 100%);
    color: #ffffff;
}

.floating-button.danger:hover {
    color: #ffffff;
}

.floating-button.dark {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    color: #ffffff;
}

.floating-button.dark:hover {
    color: #ffffff;
}

/* Size Variants */
.floating-button.small {
    padding: 12px 20px;
    font-size: 14px;
}

.floating-button.large {
    padding: 20px 32px;
    font-size: 18px;
}

/* Icon Support */
.floating-button .icon {
    display: inline-flex;
    align-items: center;
    font-size: 20px;
}

.floating-button.icon-only {
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.floating-button.icon-only.small {
    width: 48px;
    height: 48px;
}

.floating-button.icon-only.large {
    width: 72px;
    height: 72px;
}

/* Pulse Animation (for attention) */
.floating-button.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 206, 201, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Badge Support (for notifications) */
.floating-button .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #FF5252;
    color: #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #fff;
}

/* Tooltip Support */
.floating-button[data-tooltip] {
    position: relative;
}

.floating-button[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: #333;
    color: #fff;
    font-size: 14px;
    font-weight: normal;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.floating-button[data-tooltip]:hover::before {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-button {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .floating-button.bottom-right,
    .floating-button.top-right {
        right: 20px;
    }
    
    .floating-button.bottom-left,
    .floating-button.top-left {
        left: 20px;
    }
    
    .floating-button.bottom-right,
    .floating-button.bottom-left,
    .floating-button.bottom-center {
        bottom: 20px;
    }
    
    .floating-button.top-right,
    .floating-button.top-left {
        top: 20px;
    }
    
    .floating-button.icon-only {
        width: 56px;
        height: 56px;
    }
}

/* Hide text on very small screens (icon-only mode) */
@media (max-width: 480px) {
    .floating-button:not(.icon-only) .text {
        display: none;
    }
    
    .floating-button:not(.icon-only) {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
}

/* Smooth entrance animation */
.floating-button {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Multiple floating buttons stacking */
.floating-button-group {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-button-group.bottom-right {
    bottom: 30px;
    right: 30px;
}

.floating-button-group.bottom-left {
    bottom: 30px;
    left: 30px;
}

.floating-button-group .floating-button {
    position: static;
    animation: none;
}

/* Save to List Button Specific Styles */
.save-to-list-btn.floating-button {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.save-to-list-btn.floating-button .icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.save-to-list-btn.floating-button:hover .icon {
    transform: scale(1.2) rotate(10deg);
}

/* Saved state styling */
.save-to-list-btn.floating-button.saved {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.save-to-list-btn.floating-button.saved .icon {
    animation: checkmark-pop 0.5s ease-out;
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile optimization for save button */
@media (max-width: 768px) {
    .save-to-list-btn.floating-button {
        padding: 16px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .save-to-list-btn.floating-button .text {
        display: none;
    }
    
    .save-to-list-btn.floating-button {
        width: 60px;
        height: 60px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
    
    .save-to-list-btn.floating-button .icon {
        font-size: 28px;
    }
}
