/* Minecraft-style UI Components */

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    float: left;
    transform: rotate(-90deg) translate(50%, 25%);
    margin-right: 15px;
    transition: transform 0.3s ease;
}

.toggle-btn.toggle-on {
    transform: rotate(90deg) translate(-25%, 0%);
}

#unzoom-btn {
    position: fixed;
    top: 110px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1001;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

#unzoom-btn img {
    width: 26px;
    height: 26px;
    image-rendering: pixelated;
    pointer-events: none;
}

/* HUD Container */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
}

#hud > * {
    pointer-events: auto;
}

/* Coordinates display */
#coordinates {
    position: fixed;
    top: 10px;
    left: 10px;
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.7);
}

#coordinates div {
    margin: 2px 0;
}

/* Inventory panel */
#inventory-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.7);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

#inventory-title {
    text-align: center;
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 10px;
    cursor: pointer;
}

#inventory {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    gap: 8px;
}

.inventory-slot {
    width: 60px;
    height: 60px;
    background: rgba(50,50,50,0.6);
    border: 1px solid rgba(100,100,100,0.5);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-slot img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.inventory-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.inventory-slot:empty:before {
    content: '';
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
}

/* Achievements notification */
#achievement-notification {
    position: fixed;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.8);
    background: rgba(0,0,0,0.7);
    padding: 15px 25px;
    min-width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#achievement-notification.show {
    top: 80px;
}

.achievement-header {
    color: #fff;
    font-size: 18px;
    text-align: center;
    margin-bottom: 8px;
}

.achievement-title {
    color: #FFFFFF;
    font-size: 20px;
    text-align: center;
    margin-bottom: 5px;
}

.achievement-description {
    color: #AAAAAA;
    font-size: 14px;
    text-align: center;
}

/* Leaderboard panel */
#leaderboard-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.7);
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

#leaderboard-title {
    color: #fff;
    font-size: 20px;
    text-align: center;
    margin-bottom: 4px;
    padding-bottom: 8px;
    cursor: pointer;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 2px 8px;
    margin: 3px 0;
    background: rgba(50,50,50,0.4);
    border-radius: 4px;
    border-left: 3px solid transparent;
}

.leaderboard-entry.current-player {
    outline: 1px solid #fff;
    outline-offset: 2px;
}

.leaderboard-entry:nth-child(1) {
    border-left-color: #FFD700;
    background: rgba(255,215,0,0.2);
}

.leaderboard-entry:nth-child(2) {
    border-left-color: #C0C0C0;
    background: rgba(192,192,192,0.2);
}

.leaderboard-entry:nth-child(3) {
    border-left-color: #CD7F32;
    background: rgba(205,127,50,0.2);
}

.leaderboard-rank {
    color: #AAAAAA;
    font-size: 16px;
    min-width: 30px;
}

.leaderboard-player {
    color: #FFFFFF;
    font-size: 16px;
    flex: 1;
    margin: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    color: #90EE90;
    font-size: 16px;
    font-weight: bold;
}

/* Toggle buttons */
.toggle-button {
    position: fixed;
    background: rgba(0,0,0,0.7);
    color: white;
    border: 3px solid rgba(139,69,19,0.8);
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-button:hover {
    background: rgba(139,69,19,0.8);
    transform: scale(1.05);
}

.toggle-button:active {
    transform: scale(0.95);
}

#toggle-inventory {
    bottom: 20px;
    right: 20px;
}

#toggle-leaderboard {
    top: 10px;
    right: 10px;
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Scrollbar for leaderboard */
#leaderboard-panel::-webkit-scrollbar {
    width: 8px;
}

#leaderboard-panel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}

#leaderboard-panel::-webkit-scrollbar-thumb {
    background: rgba(139,69,19,0.8);
    border-radius: 4px;
}

#leaderboard-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(139,69,19,1);
}

/* Mining info tooltip */
.mining-info {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.3);
    white-space: nowrap;
    font-size: 14px;
    pointer-events: none;
    z-index: 20;
}

/* Block name display */
.block-name {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 8px 10px 2px 10px;
    font-size: 24px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 15;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #coordinates {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    #inventory {
        grid-template-columns: repeat(5, 50px);
        gap: 5px;
    }
    
    .inventory-slot {
        width: 50px;
        height: 50px;
    }
    
    .inventory-slot img {
        width: 32px;
        height: 32px;
    }
    
    #leaderboard-panel {
        max-width: 250px;
        font-size: 14px;
    }
    
    .toggle-button {
        padding: 8px 12px;
        font-size: 14px;
    }
}
