/* ===== Premium PBR Compass Component ===== */
/* A realistic, physically-based rendered compass with metallic and glass materials */

.pbr-compass-container {
    position: relative;
    width: 300px;
    height: 300px;
    perspective: 1000px;
    transform-style: preserve-3d;
    margin: 0 auto;
}

.pbr-compass {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(30deg) rotateZ(-10deg);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.pbr-compass:hover {
    transform: rotateX(15deg) rotateZ(0deg) scale(1.05);
}

/* Compass Body - Main Metallic Case */
.pbr-compass-body {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-style: preserve-3d;
    
    /* Brushed Metal Texture */
    background: radial-gradient(
        circle at 30% 30%,
        #f1f5f9 0%,
        #cbd5e1 20%,
        #94a3b8 50%,
        #64748b 100%
    );
    
    box-shadow: 
        /* Rim highlights */
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 -4px 6px rgba(0, 0, 0, 0.2),
        /* Drop shadow */
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 10px 10px rgba(0, 0, 0, 0.1);
}

/* Side Thickness - Simulated sticking out */
.pbr-compass-body::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        #e2e8f0 0%,
        #94a3b8 50%,
        #475569 100%
    );
    transform: translateZ(-15px);
    z-index: -1;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
}

/* Connecting wall (simulated with multiple shadows/layers or just visual trickery from top view)
   For a true 3D cylinder in CSS, we'd need many divs. 
   We'll use a thick border on the main element to simulate the bevel.
*/

/* Inner Rim - Gold/Brass Accent */
.pbr-compass-rim {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 4px solid #d97706; /* Fallback */
    border: 4px solid transparent;
    background: 
        linear-gradient(135deg, #fcd34d 0%, #d97706 50%, #b45309 100%) border-box;
    -webkit-mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 1px 2px rgba(255,255,255,0.5);
    transform: translateZ(5px);
}

/* Compass Face - Dark Contrasting Background */
.pbr-compass-face {
    position: absolute;
    inset: 18px;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    border-radius: 50%;
    transform: translateZ(2px);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    overflow: hidden;
}

/* Ticks and Markings */
.pbr-compass-marks {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
}

.pbr-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 10px;
    background: rgba(255,255,255,0.4);
    transform-origin: center 0;
}

/* Generate ticks using nth-child in a pre-processor is easier, 
   but manual for CSS: N, E, S, W markings */
.pbr-cardinal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    color: #f8fafc;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    pointer-events: none;
}

.pbr-cardinal span {
    position: absolute;
}
.pbr-cardinal .n { top: 0; left: 50%; transform: translateX(-50%); color: #ef4444; text-shadow: 0 0 10px rgba(239,68,68,0.5); }
.pbr-cardinal .s { bottom: 0; left: 50%; transform: translateX(-50%); }
.pbr-cardinal .e { right: 0; top: 50%; transform: translateY(-50%); }
.pbr-cardinal .w { left: 0; top: 50%; transform: translateY(-50%); }

/* The Needle */
.pbr-compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 6px;
    transform: translate(-50%, -50%) rotate(-45deg);
    transform-style: preserve-3d;
    z-index: 20;
    animation: compass-sway 4s ease-in-out infinite alternate;
}

.pbr-needle-part {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
}

.pbr-needle-north {
    right: 0;
    background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
    clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pbr-needle-south {
    left: 0;
    background: linear-gradient(90deg, #e2e8f0 0%, #94a3b8 100%);
    clip-path: polygon(100% 50%, 0% 0%, 0% 100%);
}

.pbr-center-cap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, #fcd34d 0%, #b45309 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%) translateZ(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 25;
}

/* Glass Dome reflection */
.pbr-compass-glass {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 50%,
        rgba(255, 255, 255, 0.02) 100%
    );
    transform: translateZ(20px);
    pointer-events: none;
    z-index: 30;
    box-shadow: inset 0 10px 20px rgba(255,255,255,0.3);
}

/* Floating Elements around Compass */
.pbr-compass-float {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.1),
        0 8px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateZ(40px);
    animation: float-badge 3s ease-in-out infinite;
    white-space: nowrap;
}

.pbr-float-1 {
    top: -20px;
    right: 0;
    animation-delay: 0s;
}

.pbr-float-2 {
    bottom: 20px;
    left: -20px;
    animation-delay: 1.5s;
}

.pbr-float-icon {
    color: #8B5CF6;
}

@keyframes compass-sway {
    0% { transform: translate(-50%, -50%) rotate(-50deg); }
    100% { transform: translate(-50%, -50%) rotate(-40deg); }
}

@keyframes float-badge {
    0%, 100% { transform: translateZ(40px) translateY(0); }
    50% { transform: translateZ(40px) translateY(-10px); }
}

/* Reflection/Shine animation */
/* Reflection/Shine animation removed as requested */

.pbr-float-3 {
    top: 35%;
    left: -60px;
    animation-delay: 0.8s;
}

.pbr-float-4 {
    top: 30%;
    right: -50px;
    animation-delay: 2.2s;
}

@media (max-width: 768px) {
    .pbr-compass-container {
        transform: scale(0.8);
    }
}
