/**
 * FB Resources Frontend Styles
 * Version: 1.0.0
 */

/* Floating Button */
.fbr-button-wrapper {
    position: fixed;
    z-index: 999998;
}

.fbr-floating-button {
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: normal;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.fbr-floating-button:hover,
.fbr-floating-button:focus {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    outline: none;
}

.fbr-floating-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Popup Overlay */
.fbr-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fbr-popup-overlay.active {
    opacity: 1;
}

/* Popup Container */
.fbr-popup {
    background: #fff;
    border-radius: 8px;
    min-width: 280px;
    max-width: 600px;
    width: auto;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.fbr-popup-overlay.active .fbr-popup {
    transform: scale(1);
}

/* Popup Header */
.fbr-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.fbr-popup-title {
    margin: 0;
    margin-right: 20px;
    font-size: 22px;
    color: #333;
    white-space: nowrap;
    min-width: max-content;
}

.fbr-popup-close {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: Arial, sans-serif;
    font-weight: normal;
}

.fbr-popup-close:hover {
    background: #e0e0e0;
    color: #000;
}

/* Popup Content */
.fbr-popup-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Resources List */
.fbr-resources-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fbr-resource-item {
    margin-bottom: 15px;
}

.fbr-resource-link {
    display: block;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    min-width: max-content;
}

.fbr-resource-link:hover {
    opacity: 0.8;
    background: #e9ecef;
    transform: translateX(5px);
}

.fbr-resource-link:focus {
    outline: 2px solid;
    outline-offset: 2px;
}

/* No Resources Message */
.fbr-no-resources {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 0;
}

/* Device Visibility Classes */
@media (min-width: 992px) {
    .fbr-button-wrapper:not(.fbr-visible-desktop) {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .fbr-button-wrapper:not(.fbr-visible-tablet) {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .fbr-button-wrapper:not(.fbr-visible-mobile) {
        display: none !important;
    }
    
    /* Mobile adjustments */
    .fbr-floating-button {
        font-size: 17px;
        padding: 12px 24px;
    }
    
    /* Full screen modal on mobile */
    .fbr-popup-overlay {
        padding: 0;
    }
    
    .fbr-popup {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .fbr-popup-content {
        max-height: calc(100vh - 70px);
    }
    
    .fbr-resource-link {
        font-size: 18px;
        padding: 15px 20px;
    }
}

/* Animation keyframes */
@keyframes fbr-pulse {
    0% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
}

/* Optional pulse animation for button */
.fbr-floating-button.pulse {
    animation: fbr-pulse 2s infinite;
}

/* Accessibility improvements */
.fbr-floating-button:focus,
.fbr-popup-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .fbr-button-wrapper,
    .fbr-popup-overlay {
        display: none !important;
    }
}