/* Permanent Construction Panel Styles */

.construction-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    align-items: center;
    justify-content: flex-start;
}

.construction-hex-button {
    position: relative;
    width: 80px;
    height: 92px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.construction-hex-button:hover:not(:disabled) {
    opacity: 1;
    transform: scale(1.05);
}

.construction-hex-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.construction-hex-button.selected {
    opacity: 1;
    transform: scale(1.1);
}

/* Hexagon background layer (grass texture) */
.hex-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/extracted_grass_hexes/grass_hex_c26606bc-1358-490f-9219-970fc0a664c2 (1)_3.png');
    background-size: cover;
    background-position: center;
    clip-path: polygon(50% 0%,
            100% 25%,
            100% 75%,
            50% 100%,
            0% 75%,
            0% 25%);
}

/* Hexagon frame layer (vine frame) */
.hex-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/hex_frames_textures/hex_frame_vines.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Structure icon layer */
.hex-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Permanent Construction Panel Styles */

.construction-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    align-items: center;
    justify-content: flex-start;
}

.construction-hex-button {
    position: relative;
    width: 80px;
    height: 92px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.construction-hex-button:hover:not(:disabled) {
    opacity: 1;
    transform: scale(1.05);
}

.construction-hex-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.construction-hex-button.selected {
    opacity: 1;
    transform: scale(1.1);
}

/* Hexagon background layer (grass texture) */
.hex-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/extracted_grass_hexes/grass_hex_c26606bc-1358-490f-9219-970fc0a664c2 (1)_3.png');
    background-size: cover;
    background-position: center;
    clip-path: polygon(50% 0%,
            100% 25%,
            100% 75%,
            50% 100%,
            0% 75%,
            0% 25%);
}

/* Hexagon frame layer (vine frame) */
.hex-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/hex_frames_textures/hex_frame_vines.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Structure icon layer */
.hex-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Hover effect for the icon */
.construction-hex-button:hover:not(:disabled) .hex-icon {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

/* Selected state glow */
.construction-hex-button.selected::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(ellipse at center,
            rgba(255, 107, 53, 0.5) 0%,
            transparent 70%);
    clip-path: polygon(50% 0%,
            100% 25%,
            100% 75%,
            50% 100%,
            0% 75%,
            0% 25%);
    z-index: -1;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Tooltip for structure name */
.construction-hex-button[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 30, 20, 0.95);
    color: #e8dcc5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid rgba(93, 64, 55, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Locked state (viewable but not yet buildable) */
.construction-hex-button.locked {
    opacity: 0.55;
    filter: grayscale(0.5);
}

.construction-hex-button.locked:hover {
    opacity: 0.7;
    transform: scale(1.02);
}
