/* Pet Container - Mirroring Boss Modal */
.pet-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.pet-container.active {
    display: flex;
    pointer-events: auto;
}

/* Disable touch controls when pet menu is open */
.pet-container.active ~ .touch-controls,
.pet-container.active + * .touch-controls,
body .pet-container.active ~ .touch-controls {
    pointer-events: none !important;
    z-index: 100 !important;
    opacity: 0.3;
}

.pet-container.active * {
    pointer-events: auto;
}

/* Pet Panel - styled like boss-content */
.pet-panel {
    background: #111111;
    border: 1px solid #333;
    border-radius: 8px;
    width: min(700px, 95vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    color: #e0e0e0;
    font-family: Arial, sans-serif;
    position: relative;
    overflow: hidden;
}

/* Pet Header - styled like boss-header */
.pet-header {
    background: linear-gradient(180deg, #222 0%, #111 100%);
    border-bottom: 1px solid #444;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pet-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

/* Pet Body - styled like boss-body for vertical side-by-side tabs and content */
.pet-body {
    display: flex;
    flex-direction: row;
    padding: 15px;
    gap: 15px;
    height: 65vh; /* Fixed height for independent scrolling */
    min-height: 200px;
    max-height: calc(85vh - 60px); /* Fits inside panel */
    overflow: hidden;
    width: 100%;
}

/* Pet Tabs - styled like boss-tabs */
.pet-tabs {
    display: flex;
    flex-direction: column;
    width: 150px;
    min-width: 150px;
    gap: 5px;
    border-right: 1px solid #333;
    padding-right: 15px;
    overflow-y: auto;
}

.pet-tab {
    flex-shrink: 0;
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 13px;
}

.pet-tab:hover {
    background: #333;
    color: #fff;
}

.pet-tab.active {
    background: #555;
    color: #ff9900;
    border-color: #777;
}

/* Pet Close Button */
.pet-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-close img {
    width: 20px;
    height: 20px;
}

/* Pet Content Container */
.pet-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-right: 5px;
}

/* Pet Items Container - Grid Layout */
.pet-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    align-content: start;
    align-items: start;
    justify-content: center;
    gap: 16px;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.pet-items::-webkit-scrollbar {
    width: 8px;
}

.pet-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.pet-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.pet-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Pet Item Card */
.pet-item {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(15, 15, 15, 0.9) 100%);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
}

.pet-item:hover {
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);
    border-color: rgba(255, 153, 0, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 153, 0, 0.15);
}

.pet-item.equipped {
    border-color: #ff9900;
    background: linear-gradient(135deg, rgba(45, 30, 10, 0.9) 0%, rgba(25, 15, 5, 0.9) 100%);
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.25);
}

.pet-item.equipped::before {
    content: "✓";
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff9900;
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

/* Pet Animation Container */
.pet-animation {
    width: 100px;
    height: 100px;
    position: relative;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.pet-animation img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Pet Info */
.pet-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.pet-name {
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    text-shadow: 1px 1px 2px #000;
    margin-bottom: 4px;
}

.pet-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.pet-status.equipped {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.pet-status.unequipped {
    background: rgba(255, 255, 255, 0.05);
    color: #aaaaaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Pet Actions Container */
.pet-actions {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    align-items: center;
}

/* Pet Action Button */
.pet-action-btn {
    flex: 1;
    padding: 6px 10px;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    border: 1px solid #1f618d;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pet-action-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #4aa3df 0%, #2f8cc5 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.pet-action-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.pet-action-btn.equipped {
    background: linear-gradient(180deg, #e67e22 0%, #d35400 100%);
    border-color: #a04000;
}

.pet-action-btn.equipped:hover:not(:disabled) {
    background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%);
}

.pet-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pet Delete Button */
.pet-delete-btn {
    padding: 6px 10px;
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    border: 1px solid #962d22;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 27px;
    box-sizing: border-box;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pet-delete-btn:hover {
    background: linear-gradient(180deg, #ff6b6b 0%, #d64545 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.pet-delete-btn:active {
    transform: scale(0.95);
}

/* Pet Empty State */
.pet-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #95a5a6;
    text-align: center;
    grid-column: 1 / -1;
}

.pet-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.pet-empty div:last-child {
    font-size: 16px;
}

/* Pet Loading */
.pet-loading,
.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #95a5a6;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pet-panel {
        width: 88%;
        max-width: 100%;
        max-height: 55vh;
    }

    .pet-header {
        padding: 3px 5px;
    }

    .pet-header h3 {
        font-size: 14px;
    }

    .pet-close {
        font-size: 16px;
        width: 20px;
        height: 20px;
    }

    .pet-content {
        padding: 3px;
    }

    .pet-items {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 4px;
        padding: 2px 0;
    }

    .pet-item {
        padding: 4px;
    }

    .pet-animation {
        width: 50px;
        height: 50px;
        margin-bottom: 3px;
    }

    .pet-name {
        font-size: 9px;
    }

    .pet-status {
        font-size: 7px;
        padding: 2px 4px;
    }

    .pet-actions {
        gap: 3px;
        margin-top: 3px;
    }

    .pet-action-btn {
        padding: 3px 6px;
        font-size: 8px;
    }

    .pet-delete-btn {
        padding: 3px 6px;
        font-size: 10px;
        min-width: 24px;
    }

    .pet-item.equipped::before {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: 4px;
        right: 4px;
    }

    .pet-empty {
        padding: 20px 10px;
    }

    .pet-empty-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .pet-empty div:last-child {
        font-size: 12px;
    }

    .pet-loading,
    .loading-message {
        padding: 20px 10px;
        font-size: 12px;
    }
}








