/* 3D Rotatable Tag Styles */

.tag-3d-container {
    perspective: 1000px;
    width: 400px;
    height: 500px;
    margin: 0 auto;
    position: relative;
}

.tag-3d {
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    position: relative;
}

/* Remove automatic rotation, will use scroll-based rotation instead */

.tag-3d.flipped {
    transform: rotateY(180deg);
}

.tag-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
}

.tag-front {
    background-color: transparent;
    z-index: 2;
}

.tag-back {
    background-color: transparent;
    transform: rotateY(180deg);
}

.tag-side img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Controls for the tag - flip icon */
.tag-title {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.tag-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.tag-control-btn {
    background: rgba(0, 81, 181, 0.7);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tag-control-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.tag-control-btn:active {
    transform: translateY(0);
}

.tag-control-btn::before {
    content: '↻';
    font-size: 18px;
    font-weight: bold;
}

/* Scroll-based rotation calculation */
.tag-3d {
    transform: rotateY(0deg); /* Starting position */
}

/* Remove animation keyframes, using inline transform in JS instead */

/* Label for the tag - move to bottom */
.tag-caption {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* For touch devices */
@media (hover: none) {
    .tag-3d-container {
        cursor: pointer;
    }
    
    .tag-control-btn {
        padding: 10px 20px; /* Larger buttons for touch */
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tag-3d-container {
        width: 240px;
        height: 320px;
    }
}

@media (max-width: 480px) {
    .tag-3d-container {
        width: 200px;
        height: 280px;
    }
}
