/* Compass Tool Styles - Minimal Precision Theme */

.compass-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 28px 28px 24px;
    border-radius: 24px;
    background: linear-gradient(160deg, #fdfcfb 0%, #eef3f8 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    --compass-needle-head: clamp(110px, 32vw, 150px);
    --compass-needle-tail: clamp(90px, 28vw, 130px);
}

.compass-container::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    pointer-events: none;
}

[data-bs-theme="dark"] .compass-container {
    background: linear-gradient(160deg, #101828 0%, #1f2937 100%);
    border-color: rgba(71, 85, 105, 0.65);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
}

.compass-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
}

.compass-rose {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f2f4f8 55%, #e2e8f0 90%, #d8dee6 100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    border: 8px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 6px 18px rgba(148, 163, 184, 0.25), inset 0 -10px 20px rgba(148, 163, 184, 0.15);
}

[data-bs-theme="dark"] .compass-rose {
    background: radial-gradient(circle at 50% 40%, #1c2836 0%, #0f172a 65%, #0b1629 100%);
    border-color: rgba(100, 116, 139, 0.8);
    box-shadow: inset 0 6px 18px rgba(30, 41, 59, 0.6), inset 0 -12px 24px rgba(15, 23, 42, 0.9);
}

.compass-outer-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(100, 116, 139, 0.25);
}

.compass-face {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(248, 250, 252, 0.95) 0%, rgba(238, 242, 250, 0.95) 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 12px 20px rgba(15, 23, 42, 0.06), inset 0 -10px 14px rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .compass-face {
    background: radial-gradient(circle, rgba(17, 24, 39, 0.95) 0%, rgba(11, 22, 35, 0.95) 100%);
    border-color: rgba(71, 85, 105, 0.5);
}

.compass-face::before,
.compass-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.compass-face::before {
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin: 10px;
}

.compass-face::after {
    border: 1px dashed rgba(148, 163, 184, 0.25);
    margin: 18px;
}

[data-bs-theme="dark"] .compass-face::before {
    border-color: rgba(100, 116, 139, 0.35);
}

[data-bs-theme="dark"] .compass-face::after {
    border-color: rgba(71, 85, 105, 0.45);
}

.compass-direction {
    position: absolute;
    font-weight: 600;
    color: #0f172a;
    user-select: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
    font-size: clamp(16px, 3.8vw, 18px);
}

[data-bs-theme="dark"] .compass-direction {
    color: #e2e8f0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.compass-n {
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(20px, 4.6vw, 26px);
    color: #dc2626;
}

[data-bs-theme="dark"] .compass-n {
    color: #f97316;
}

.compass-e {
    right: 4%;
    top: 50%;
    transform: translateY(-50%);
}

.compass-s {
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
}

.compass-w {
    left: 4%;
    top: 50%;
    transform: translateY(-50%);
}

.compass-ne,
.compass-se,
.compass-sw,
.compass-nw {
    font-size: clamp(13px, 3vw, 15px);
    color: rgba(15, 23, 42, 0.7);
}

[data-bs-theme="dark"] .compass-ne,
[data-bs-theme="dark"] .compass-se,
[data-bs-theme="dark"] .compass-sw,
[data-bs-theme="dark"] .compass-nw {
    color: rgba(226, 232, 240, 0.8);
}

.compass-ne { top: 14%; right: 14%; }
.compass-se { bottom: 14%; right: 14%; }
.compass-sw { bottom: 14%; left: 14%; }
.compass-nw { top: 14%; left: 14%; }

.degree-markers {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.degree-marker {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    transform-origin: center center;
    pointer-events: none;
}

.degree-marker::before {
    content: '';
    position: absolute;
    top: 9%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 7px;
    background: rgba(15, 23, 42, 0.18);
}

.degree-marker.medium::before {
    height: 11px;
    background: rgba(15, 23, 42, 0.3);
}

.degree-marker.major::before {
    height: 16px;
    width: 2px;
    background: rgba(15, 23, 42, 0.5);
}

.degree-marker.major span {
    position: absolute;
    top: calc(9% + 18px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.6);
    letter-spacing: 0.06em;
}

[data-bs-theme="dark"] .degree-marker::before {
    background: rgba(226, 232, 240, 0.2);
}

[data-bs-theme="dark"] .degree-marker.medium::before {
    background: rgba(226, 232, 240, 0.35);
}

[data-bs-theme="dark"] .degree-marker.major::before {
    background: rgba(226, 232, 240, 0.55);
}

[data-bs-theme="dark"] .degree-marker.major span {
    color: rgba(226, 232, 240, 0.75);
}

.compass-arrow-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    width: 0;
    height: 0;
    pointer-events: none;
}

.compass-arrow {
    position: relative;
    width: 0;
    height: 0;
}

.arrow-head {
    position: absolute;
    top: calc(-1 * var(--compass-needle-head));
    left: -11px;
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: var(--compass-needle-head) solid #ef4444;
    filter: drop-shadow(0 8px 14px rgba(248, 113, 113, 0.35));
}

.arrow-head::before {
    content: '';
    position: absolute;
    top: 14px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: calc(var(--compass-needle-head) * 0.45) solid rgba(255, 255, 255, 0.3);
}

.arrow-tail {
    position: absolute;
    top: -6px;
    left: -11px;
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: var(--compass-needle-tail) solid rgba(100, 116, 139, 0.85);
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.25));
}

.arrow-tail::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: calc(var(--compass-needle-tail) * 0.4) solid rgba(255, 255, 255, 0.25);
}

[data-bs-theme="dark"] .arrow-head {
    border-bottom-color: #f97316;
}

[data-bs-theme="dark"] .arrow-tail {
    border-top-color: rgba(203, 213, 225, 0.9);
}

.compass-center {
    position: absolute;
    top: -13px;
    left: -13px;
    width: 26px;
    height: 26px;
    background: radial-gradient(circle, #f8fafc 0%, #cbd5f5 100%);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    z-index: 30;
}

.compass-center::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e293b;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .compass-center {
    background: radial-gradient(circle, #1f2937 0%, #0f172a 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .compass-center::after {
    background: #e2e8f0;
}

.heading-indicator {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 18;
    pointer-events: none;
}

.indicator-triangle {
    width: 36px;
    height: 18px;
    background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 100%);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.25);
}

[data-bs-theme="dark"] .indicator-triangle {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.heading-display {
    margin-top: 32px;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
    padding: 20px 28px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] .heading-display {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(71, 85, 105, 0.5);
}

.heading-value {
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
    margin-bottom: 6px;
}

[data-bs-theme="dark"] .heading-value {
    color: #f8fafc;
}

.heading-direction {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: rgba(71, 85, 105, 0.8);
}

[data-bs-theme="dark"] .heading-direction {
    color: rgba(203, 213, 225, 0.85);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.info-row:last-child {
    border-bottom: none;
}

[data-bs-theme="dark"] .info-row {
    border-bottom-color: rgba(71, 85, 105, 0.45);
}

.info-label {
    color: rgba(71, 85, 105, 0.8);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

[data-bs-theme="dark"] .info-label {
    color: rgba(203, 213, 225, 0.75);
}

.info-row strong {
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
}

[data-bs-theme="dark"] .info-row strong {
    color: #f8fafc;
}

.guide-list {
    padding-left: 18px;
    margin: 0;
    list-style: none;
}

.guide-list li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 12px;
    color: rgba(51, 65, 85, 0.9);
    line-height: 1.6;
    font-size: 14px;
}

.guide-list li::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

[data-bs-theme="dark"] .guide-list li {
    color: rgba(203, 213, 225, 0.85);
}

[data-bs-theme="dark"] .guide-list li::before {
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.45);
}

@media (max-width: 768px) {
    .compass-container {
        max-width: 360px;
        padding: 24px;
    }

    .heading-value {
        font-size: 46px;
    }
}

@media (max-width: 576px) {
    .compass-container {
        max-width: 300px;
        padding: 20px;
    }

    .heading-display {
        margin-top: 24px;
        padding: 18px 24px;
    }

    .heading-value {
        font-size: 40px;
    }

    .heading-direction {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .compass-container {
        max-width: 260px;
    }

    .compass-n {
        font-size: 20px;
    }
}

.card:fullscreen,
.card:-webkit-full-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 0;
    background: linear-gradient(150deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-bs-theme="dark"] .card:fullscreen,
[data-bs-theme="dark"] .card:-webkit-full-screen {
    background: linear-gradient(150deg, #0f172a 0%, #111827 100%);
}

.card:fullscreen .compass-container,
.card:-webkit-full-screen .compass-container {
    max-width: none;
    width: min(70vh, 640px);
    padding: clamp(22px, 4vh, 32px);
}

.card:fullscreen .compass-wrapper,
.card:-webkit-full-screen .compass-wrapper {
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .compass-rose,
    * {
        transition: none !important;
        animation: none !important;
    }
}
