/* Refresh Button - 3D Isometric Flipping Book */
.fixed-refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #1a5fb4, #1c92d2);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: grab;
    z-index: 2147483647;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    border: 2px solid rgba(255,255,255,0.3);
    touch-action: none; /* Prevents scrolling while dragging */
}

.fixed-refresh-btn:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* 3D Book Container */
.book-3d-wrapper {
    width: 32px;
    height: 22px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(30deg) rotateY(-30deg) rotateZ(-10deg);
}

/* Book Base/Cover */
.book-base {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left: 3px solid #1a5fb4; /* Spine color */
}

/* Individual Pages */
.book-page {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: #fff;
    border-left: 1px solid #ddd;
    transform-origin: left center;
    animation: flip3d 2s infinite ease-in-out;
    backface-visibility: visible;
}

.book-page:nth-child(2) { animation-delay: 0.3s; }
.book-page:nth-child(3) { animation-delay: 0.6s; }

@keyframes flip3d {
    0% {
        transform: rotateY(0deg);
        background: #fff;
    }
    50% {
        background: #f0f0f0;
    }
    80%, 100% {
        transform: rotateY(-180deg);
        background: #e0e0e0;
    }
}

/* Text lines on pages */
.book-page::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: #eee;
    box-shadow: 0 3px 0 #eee, 0 6px 0 #eee, 0 9px 0 #eee;
}

/* Drag State Decoration */
.fixed-refresh-btn.dragging {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Hidden state for settings toggle */
.fixed-refresh-btn.hidden {
    display: none !important;
}

.refresh-tooltip {
    position: absolute;
    bottom: 80px;
    right: 50%;
    transform: translateX(50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.fixed-refresh-btn:hover .refresh-tooltip {
    opacity: 1;
    transform: translateX(50%) translateY(-10px);
}
