/**
 * Basics Fonts CORE - Frontend Preview Menu
 * Styling for the font sets preview switcher
 *
 * @package BasicsFontsCore
 * @version 1.0.0
 */

/* Preview Menu Container */
.bcore-preview-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Toggle Button */
.bcore-preview-toggle {
    background: #2271b1;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.bcore-preview-toggle:hover {
    background: #135e96;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.bcore-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bcore-preview-icon svg {
    width: 20px;
    height: 20px;
}

.bcore-preview-text {
    font-weight: 600;
}

/* Preview Panel */
.bcore-preview-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bcore-preview-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel Header */
.bcore-preview-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bcore-preview-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.bcore-preview-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.bcore-preview-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Panel Content */
.bcore-preview-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.bcore-preview-description {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #fff;
    line-height: 1.5;
}

/* Font Sets List */
.bcore-preview-sets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

/* Font Set Button */
.bcore-preview-set-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: #f6f7f7;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bcore-preview-set-btn:hover {
    background: #f0f0f1;
    color: #2271b1;
    border-color: #2271b1;
    transform: translateX(4px);
}

.bcore-preview-set-btn.active {
    background: #e7f3ff;
    color: #2271b1;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.bcore-preview-set-btn.previewing {
    background: #fff8e5;
    color: #2271b1;
    border-color: #dba617;
    box-shadow: 0 0 0 1px #dba617;
}

.bcore-set-name {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.bcore-set-description {
    font-size: 12px;
    color: #646970;
    line-height: 1.4;
}

/* Preview Info */
.bcore-preview-info {
    padding: 12px;
    background: #f6f7f7;
    border-radius: 6px;
    border-left: 3px solid #2271b1;
}

.bcore-preview-info small {
    font-size: 12px;
    color: #fff;
    line-height: 1.5;
    display: block;
}

/* Loading State */
.bcore-preview-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #646970;
}

.bcore-preview-loading.show {
    display: block;
}

.bcore-preview-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f1;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: bcore-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes bcore-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .bcore-preview-menu {
        bottom: 10px;
        right: 10px;
    }

    .bcore-preview-panel {
        width: calc(100vw - 40px);
        max-width: 320px;
    }

    .bcore-preview-toggle {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Animation for panel appearance */
@keyframes bcore-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.bcore-preview-set-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.bcore-preview-toggle:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bcore-preview-panel {
        background: #1d2327;
        color: #f0f0f1;
    }

    .bcore-preview-set-btn {
        background: #2c3338;
        border-color: #3c434a;
        color: #2271b1;
    }

    .bcore-preview-set-btn:hover {
        background: #3c434a;
        border-color: #2271b1;
    }

    .bcore-set-name {
        color: #2271b1;
    }

    .bcore-preview-info {
        background: #2c3338;
    }
}

/* Smooth transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
