/* Gyroscope Tester Styles */

/* Gyro Ring Container */
.gyro-ring-container {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    position: relative;
}

.gyro-ring-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Cube Canvas Wrapper */
.cube-canvas-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    position: relative;
    background-color: var(--bs-body-bg);
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

#cubeCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Compass Display */
.compass-display {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compass-icon {
    transition: transform 0.3s ease-out;
    filter: var(--bs-primary);
}

[data-bs-theme="dark"] .compass-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(96%) saturate(2976%) hue-rotate(195deg) brightness(101%) contrast(91%);
}

#compassHeading {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

#compassDirection {
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* Badge Styles */
#alphaValue, #betaValue, #gammaValue {
    min-width: 70px;
    text-align: center;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Form Labels */
.form-label strong {
    font-size: 1rem;
}

.form-label small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Info textarea styling */
#info {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Card Styles */
.card-body > div:not(:last-child) {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gyro-ring-container {
        max-width: 160px;
    }

    .cube-canvas-wrapper {
        max-width: 100%;
    }

    #alphaValue, #betaValue, #gammaValue {
        min-width: 60px;
        font-size: 0.8rem;
    }

    .form-label strong {
        font-size: 0.9rem;
    }

    .form-label small {
        font-size: 0.75rem;
        display: block;
        margin-top: 0.25rem;
    }

    #compassHeading {
        font-size: 1.25rem;
    }

    .compass-display {
        width: 80px;
        height: 80px;
    }

    .compass-icon {
        width: 48px !important;
        height: 48px !important;
    }
}

/* Animation for rotating elements */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions */
canvas {
    transition: opacity 0.2s ease;
}

/* Loading state */
.gyro-ring-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--bs-border-color);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
